restricting non asp.net files while using form authentication

A

amit

hi,

I have a web application using forms based authentication. I want to
restrcit even the non asp.net files from forms authentication i.e I do not
want that my clients should be able to access the word files, ,xls, pdf etc
from outside project. Actually these files appear as links like :
http://hp-amit/testfolder/abc.doc

now if i copy this link and directly type this without loging on to the site
it would still access it. whereas if i try an access any other ASPX page, it
redirects to the login page.
One way of solving this is that I edit the IIS Mappings to support these
files but I want to use it programmatically thru code and not thru IIS.

If there is no other viable solution, Is there a script available which can
be executed to automate this task/

thanks in advance.

bye
amit purohit
 
A

avnrao

in your web.config for that application..try this

<httpHandlers>
<add verb="*" path="*.doc" type="System.Web.HttpForbiddenHandler"/>
</httpHandlers>

Av.
 
A

amit

hi,

even then i would have to do IIS mappings, I want to move away from this
problem of configuring IIS for extensions or what I can instead do is
automate this job, but for that I would need a script ,

thanks for the prompt reply last time ,
bye
amit
 

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,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top