Re: Protect local data files from download?

Discussion in 'ASP .Net' started by Ken Cox [Microsoft MVP], Jul 5, 2003.

  1. Right after I explain how to do it, I find that there's a KB article!

    HOW TO: Use ASP.NET to Protect File Types

    http://support.microsoft.com/default.aspx?scid=kb;en-us;815152

    "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)
     
    Ken Cox [Microsoft MVP], Jul 5, 2003
    #1
    1. Advertising

  2. "Ken Cox [Microsoft MVP]" <>:
    > Right after I explain how to do it, I find that there's a KB article!
    >
    > HOW TO: Use ASP.NET to Protect File Types
    >
    > http://support.microsoft.com/default.aspx?scid=kb;en-us;815152


    Thanks! But I may need a scheme for cases in which one doesn't control IIS
    configuration, such as a shared server at a commericial hosting company.
    Based on your and the KB article's instruction and after looking at
    machine.config I think that all that needs to be done is to rename the data
    files with extensions that won't be served, such as .vb, .cs, or .asp.

    > "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 5, 2003
    #2
    1. Advertising

  3. >Based on your and the KB article's instruction and after looking at
    >machine.config I think that all that needs to be done is to rename the data
    >files with extensions that won't be served, such as .vb, .cs, or .asp.


    Good idea. You might just be able to rename it .config or .vbproj so it won't
    get in the way of anything else.

    Ken
     
    Ken Cox [Microsoft MVP], Jul 5, 2003
    #3
    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. Steve C. Orr, MCSD

    Re: Protect local data files from download?

    Steve C. Orr, MCSD, Jul 4, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    321
    Steve Brecher
    Jul 4, 2003
  2. MS News \(MS ILM\)
    Replies:
    1
    Views:
    425
    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,635
    George Ter-Saakov
    Apr 29, 2004
  4. Steve Brecher
    Replies:
    3
    Views:
    286
    Mark Rafn
    Feb 10, 2007
  5. js

    download file protect

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

Share This Page