How do I protect static files with ASP.NET form auhentication on IIS 7.5?
Posted
by Egil Hansen
on Stack Overflow
See other posts from Stack Overflow
or by Egil Hansen
Published on 2010-05-25T09:06:31Z
Indexed on
2010/05/25
9:11 UTC
Read the original article
Hit count: 279
Hi all
I have a website running on a IIS 7.5 server with ASP.NET 4.0 on a shared host, but in full trust.
The site is a basic "file browser" that allows the visitors to login and have a list of files available to them displayed, and, obviously, download the files. The static files (mostly pdf files) are located in a sub folder on the site called data, e.g. http://example.com/data/...
The site uses ASP.NET form authentication.
My question is: How do I get the ASP.NET engine to handle the requests for the static files in the data folder, so that request for files are authenticated by ASP.NET, and users are not able to deep link to a file and grab files they are not allowed to have?
Best regards, Egil.
© Stack Overflow or respective owner