Reply to topic
Locking a Directory
KyleGobel


Joined: 02 Jun 2006
Posts: 8
Reply with quote
Hello, I have some files that I don't want to be able to do be downloaded by anonymous users. I thought the answer was just use the ASP.net login controls, and set the Web.Config file to deny anonymous users to the directory. It turns out that it only works for Asp.net pages or things that go through the ASPNET engine, and not static content or dynamic stuff handled by other engines (e.g. CGI, ASP)

I'm wondering how I can lock out the directory, but allow users who are logged in (via the asp.net controls) into the directory, free to download everything.

Thanks,
Kyle Gobel
jraybould


Joined: 29 Apr 2006
Posts: 46
Reply with quote
you could have the authentication done through windows (you'd have to contact support@hostmysite.com to get this setup). if you want to do it through .net, then you'll have to have different application extensions (cgi, asp...) interpretted through the .net engine (i think that works). This also would have to be done by the support team. The nice thing is, you can define those extensions to use .net in a particular sub-folder only, so your whole site doesn't have to give up using those extensions with their native engine.
pmeserve
HostMySite Tech

Joined: 19 Mar 2004
Posts: 178
Reply with quote
Kyle - my thought is the best way would be put all the static files in their own directly, e.g. /static. Then ask HMS support to remove read access to this directory in IIS - this way no one can directly access the files

Then, within your application, make a simple "funnel" script that just:
* verifies that a user is logged in
* passes a file to them

So for instance a user would go to:
http://mydomain.com/funnel.aspx?file=image.png

The script would just grab the file and send the user the appropriate content-type headers and then the content of the file
Locking a Directory
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 1  

  
  
 Reply to topic