Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

protect files (not asp files) in a folder using asp

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I have a folder that contains some important files. I want to have a password protect this folder, and only allow the persons with the right username and password to download the files. The username and password have to be from the database.

I come up with some ideas but i don't know how to make it works.

1. Use asp to check username and passwords, and then if it is correct then send a file that locate not in to the user.>>>I don't know how to send a file to an user

2. Use server password to protect a folder, and use asp script (base on session) to disable the password protected folder.>>>also i don't know how to enable the access through the folder

If somebody having any ideas to make this work or any ideas to make my ideas work, please help me
 
If somebody has any ideas about how to protect files in a folder, please help me
 
I spent a while researching this but could'nt find any way for non ASP content. You can set the folder permissions so challenge and response is required but if you need to verify access against a database there's no way I could find.

The best I could do was only display links to the files if the visitor had sucessfully logged in. Whether logged in can be checked against a session variable for instance. This is not ideal though, as if someone knows the path they can still get to the file.
 
A solution to this problem can be found here: thread333-414973 with example code provided by myself and the original poster. This only shows pdf's, html documents, etc but you can add more documents relatively easily by adding their MIME types to the case statement. The referenced thread above also references a previous thread of mine that is for file downloading rather than opening in a browser.

-Tarwn --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top