By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,592 Members | 1,931 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,592 IT Pros & Developers. It's quick & easy.

restricting non asp.net files while using form authentication

P: n/a
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


Nov 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
in your web.config for that application..try this

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

Av.

"amit" <am**********@rsystems.com> wrote in message
news:eH**************@TK2MSFTNGP12.phx.gbl...
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

Nov 18 '05 #2

P: n/a
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
"avnrao" <av*@newsgroups.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
in your web.config for that application..try this

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

Av.

"amit" <am**********@rsystems.com> wrote in message
news:eH**************@TK2MSFTNGP12.phx.gbl...
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


Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.