Restricted access download

Discussion in 'ASP .Net' started by Luciano \(DOC\), Sep 1, 2010.

  1. I have some files into a directory, only logged users must be allowed to
    download them.
    I have created a page which verify if the user is logged in, but how can I
    avoid that someone knowing the path of files write the url directly?
    Thanks.

    Luciano
     
    Luciano \(DOC\), Sep 1, 2010
    #1
    1. Advertising

  2. Luciano \(DOC\)

    Jason Keats Guest

    Luciano (DOC) wrote:
    > I have some files into a directory, only logged users must be allowed to
    > download them.
    > I have created a page which verify if the user is logged in, but how can I
    > avoid that someone knowing the path of files write the url directly?
    > Thanks.


    Don't use the file path in your URL. Instead, pass the file name to a
    download page in your query string. The download page can get the path
    from the config file.

    http://www.mydomain.com/download.aspx?file=whatever.pdf

    might actually stream the file from

    http://www.mydomain.com/qwerty/azerty/whatever.pdf

    download.aspx should check that the user is logged in and can also be
    used to track downloads - logging when/what/who.
     
    Jason Keats, Sep 2, 2010
    #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. Thomas G. Marshall
    Replies:
    6
    Views:
    435
    Thomas Hawtin
    Oct 20, 2005
  2. PW
    Replies:
    0
    Views:
    379
  3. Oli Filth
    Replies:
    1
    Views:
    456
    ...D.
    Jan 29, 2005
  4. iapain

    Restricted Access

    iapain, Jul 10, 2006, in forum: Python
    Replies:
    22
    Views:
    775
    iapain
    Jul 12, 2006
  5. Keith R
    Replies:
    2
    Views:
    447
    =?Utf-8?B?QklUUyBlcnJvciBjb2RlIC0yMTQ3MDI0ODkxIG9y
    Apr 24, 2007
Loading...

Share This Page