Blocking files via. web.config

D

David

I am installing apps on an asp.net 1.1 machine to which I have no
access to the IIS configuration. I need to lock out the viewing of
files types in a directory. As per info on the net, I added the
following in the web.config. However, when I directly address the
files via. www.testsite.com/test.logs, the system shows the file. Is
there other option I need to add to the config or is this an issue
with the way that IIS was installed on the machine?

Thanks


<httpHandlers>
<add verb="*" path="*.pdf"
type="System.Web.HttpForbiddenHandler"/>
<add verb="*" path="*.logs"
type="System.Web.HttpForbiddenHandler"/>
</httpHandlers>
 
B

Bruce Barker

you need to update the iis file mapping.

the web.config only effects files which are mapped to asp.net by iis. if
asp.net doesn't see the file, it can not respond.

-- bruce (sqlwork.com)
 
G

Guest

IIS is serving the files without consulting ASP.NET, which is why your
web.config settings have no effect. If you are unable to adjust the IIS
settings then you'll need to try a different approach, such as storing the
files in a private directory or database and serving the files through a
special page that acts as the gatekeeper.

Here's more info:
http://SteveOrr.net/articles/EasyUploads.aspx
 

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

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top