Restricted access download

  • Thread starter Luciano \(DOC\)
  • Start date
L

Luciano \(DOC\)

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
 
J

Jason Keats

Luciano said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top