Groups | Blog | Home
all groups > dotnet xml > october 2005 >

dotnet xml : limiting access to files with asp.net


Daniel
10/14/2005 4:57:07 PM
limiting access to files with asp.net

is there any way i can make a file only accessible to certain users of my
website? my files are to large to copy to a temp directory and they are of
many types, .exe .xsl .xml etc. i want an href to each file but only allow
users who have the right login-info in their session variable to get to the
files in their directory. is there something built into .net for doing this?
do i need to do some kind of isapi filter and then stream them?

Gomolyako Eduard
10/17/2005 6:45:49 AM
Yes, you can. At IIS, choose site properties, at "Home Directory" tab
click at "Configuration..." button in "application settings" section.
Add application mapping with folowing parameters:
executable: C:\WINNT\Microsoft.NET\Framework\v1.1.4322\aspnet_isapi.dll
(C:\WINNT - your windows instalation directory here)
extension: *.*
everything else as consider necessary

after that in global.asax.cs u can handle requests to all types files,
validate user login and so forth.

Best, Ed.
Daniel
10/17/2005 11:27:28 AM
i will try this now, u r the man

[quoted text, click to view]

Gomolyako Eduard
10/18/2005 6:15:51 AM
Good luck. Apply for information if u'll have any troubles.

Best, Ed.
AddThis Social Bookmark Button