
February 13th, 2004, 12:47 PM
|
|
Registered User
|
|
Join Date: Feb 2004
Posts: 2
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
Quote: | Originally Posted by tngaijin Please clearify if I am wrong. I assume that you want to allow your users to be able to download a file via the internet. If not ignore what I write here.
The simplest way is to link directly to a resource from within an ASP page. If your serving program has its security set correctly you can control what a user can access even though they can open your HTML source and see where the relative link leads to. For example, I have my root folder for my website and then in that same directory I have a folder called downloads. Inside of downloads I have a file called "tnsFavoriteRecipes.txt". The security settings on the downloads folder says that it is not accessable by internet users but it is accessable by the system. Now in your webpage you my have a link with a relative path like this:
../downloads/tnsFavoriteRecipes.txt
Clicking on this link will open a generic windows dialogue box (assuming you are browsing on windows OS), but if the user views your source and then tries to type the folder path into the URL, they will be restricted from viewing the contents of the folder.
This is the most basic method for this. There is however a more elegant yet more difficult to code answer. Luckily, author Jason Withrow has kindly provided example source code for this solution which can be found here:
URL
Hope this helps!
- tn |
Thanks a lot.
Nir.
|