Re: Protect local data files from download?

Discussion in 'ASP .Net' started by Steve C. Orr, MCSD, Jul 4, 2003.

  1. Just make sure that the extension of the file is unkown to IIS. Give the
    file a name like data.xyz or something. Then IIS will never serve it up to
    anybody.

    --
    I hope this helps,
    Steve C. Orr, MCSD
    http://Steve.Orr.net


    "Steve Brecher" <> wrote in message
    news:OfJrx%...
    > The Global.asax.vb contains code called from Application_Start that opens
    > and reads some data files which in total contain about 35KB. For
    > portability of the web application (e.g., to one remote host or another)

    it
    > seems best to keep this data within the application directory or a
    > subdirectory thereof, so that its path can be obtained at runtime via
    > HttpContext.Current.Server.MapPath.
    >
    > Is there a way to allow the web app to open/read the data files but to
    > protect them from downloading by the user?
    >
    > --
    > For mail, please use my surname where indicated:
    > (Steve Brecher)
    >
    >
    Steve C. Orr, MCSD, Jul 4, 2003
    #1
    1. Advertising

  2. "Steve C. Orr, MCSD" <> wrote:
    > Just make sure that the extension of the file is unkown to IIS. Give the
    > file a name like data.xyz or something. Then IIS will never serve it up

    to
    > anybody.


    The extension has been .csv (an Excel file type) and IE6 presents a download
    dialog. If I change the extension to .xyz or to .steve, IE6 displays the
    contents of the file (as it would if the extension were .txt).

    > "Steve Brecher" <> wrote in message
    > news:OfJrx%...
    > > The Global.asax.vb contains code called from Application_Start that

    opens
    > > and reads some data files which in total contain about 35KB. For
    > > portability of the web application (e.g., to one remote host or another)

    > it
    > > seems best to keep this data within the application directory or a
    > > subdirectory thereof, so that its path can be obtained at runtime via
    > > HttpContext.Current.Server.MapPath.
    > >
    > > Is there a way to allow the web app to open/read the data files but to
    > > protect them from downloading by the user?


    --
    For mail, please use my surname where indicated:
    (Steve Brecher)
    Steve Brecher, Jul 4, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ken Cox [Microsoft MVP]

    Re: Protect local data files from download?

    Ken Cox [Microsoft MVP], Jul 5, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    349
    Ken Cox [Microsoft MVP]
    Jul 5, 2003
  2. MS News \(MS ILM\)
    Replies:
    1
    Views:
    420
    Scott Schluer
    Aug 19, 2003
  3. Pavils Jurjans

    Protect bin folder from direct download

    Pavils Jurjans, Apr 29, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    1,621
    George Ter-Saakov
    Apr 29, 2004
  4. Steve Brecher
    Replies:
    3
    Views:
    281
    Mark Rafn
    Feb 10, 2007
  5. js

    download file protect

    js, Apr 1, 2005, in forum: ASP General
    Replies:
    4
    Views:
    114
Loading...

Share This Page