hi friends
i have one problem. i m using forms authentication for my pages which consist of downloadable links (doc files, pdf files etc.,). the thing is, if i restrict access to the page, it works fine ( redirects anonymous users to login page). however, if someone types the url of the documents directly (ex:- mywebserver/myapp/downloads/documentname, it directly downloads without authenticating.
any way to restrict direct downloading of files?
am using web.config file like this
but it is not working
pls guide me
it is very urgent
pls give sample code
thanks
i have one problem. i m using forms authentication for my pages which consist of downloadable links (doc files, pdf files etc.,). the thing is, if i restrict access to the page, it works fine ( redirects anonymous users to login page). however, if someone types the url of the documents directly (ex:- mywebserver/myapp/downloads/documentname, it directly downloads without authenticating.
any way to restrict direct downloading of files?
am using web.config file like this
Code:
<?xml version="1.0"?>
<configuration>
<location path="images">
<system.web>
<httpHandlers >
<httpHandlers>
<add verb="*" path="*.jpg" type="HTTPjpegAccess.HTTPjpegAccess, HTTPjpegAccess"/>
</httpHandlers>
</httpHandlers>
<authentication mode="Forms">
<forms loginUrl="login.aspx">
<credentials passwordFormat="Clear">
<user name="yoga" password="yoga" />
</credentials>
</forms>
</authentication>
</system.web>
</location>
</configuration>
pls guide me
it is very urgent
pls give sample code
thanks
Comment