How to authorize download?

L

lenyado

I am planning a website which reqires this feature: it allows registered
users to upload and/or download files (like *.doc, *.ppt etc.) but not
everyone can download every files. some files are restricted to certain users
only. that means only certain users can download certain files. but if the
URL of a certain file that needed to be protected is exposed, the
authorization will be in vain. any solutions?
 
B

Ben Lucas

You could write an HttpHandler or an HttpModule to handle the security.
Basically your HttpHandler or HttpModule would need to perform the security
check and give an Access Denied message if the user does not have access, or
if the user does have access, set the content type and write the file to the
Response stream.

Also, note that you will have to set up IIS so that the ASP.Net application
handles .doc, .ppt, and whatever other files you want to provide security
for.
 
D

Daniel Fisher\(lennybacon\)

Write the files based on a querystringvariable as binary to the response
stream (if the user is authenticated, otherwise send him some greetings with
a errormessage) - so you don't have to reconfigure IIS and nobody has knows
the path to the files.
 

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

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top