Groups | Blog | Home
all groups > asp.net security > july 2006 >

asp.net security : Password protect .jpg or .pdf


cjburkha
7/24/2006 2:49:03 PM
Hi,

I've been searching the web and google for a while now, and can't find
how to do exactly what I want to do. I'm sorry if this has been
answered before, I just cant find it.

My idea is to have a folder /root/public/secure which has a web.config
file in it like so
<authorization>
<deny users="?" />
</authorization>

Now in that folder, protected.aspx is protected, but protected.pdf is
not protected.

I use
<httpHandlers>
<add verb="*" path="*.mdb" type="System.Web.HttpForbiddenHandler"
/>
</httpHandlers>

to protect my .mdb. But this dis-allows downloading. I want to allow
authenticated downloading. Something like
System.Web.HttpAuthenticatedHandler. But I can not find that handler.

Any ideas? I hear of people using response.write, but I don't feel that
is what I want to do.

Thanks for any help/hints you can give
Joe Kaplan (MVP - ADSI)
7/24/2006 5:39:33 PM
StaticFileHandler, in conjunction with the right metabase mappings in IIS,
is what you want.

Joe K.

--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
--
[quoted text, click to view]

cjburkha
7/25/2006 6:37:55 AM
Great, thank you for that tip.
[quoted text, click to view]
AddThis Social Bookmark Button