Password protect .jpg or .pdf

Discussion in 'ASP .Net Security' started by cjburkha, Jul 24, 2006.

  1. cjburkha

    cjburkha Guest

    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
    cjburkha, Jul 24, 2006
    #1
    1. Advertising

  2. 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
    --
    "cjburkha" <> wrote in message
    news:...
    > 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\), Jul 24, 2006
    #2
    1. Advertising

  3. cjburkha

    cjburkha Guest

    Great, thank you for that tip.
    Joe Kaplan (MVP - ADSI) wrote:
    > 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
    > --
    > "cjburkha" <> wrote in message
    > news:...
    > > 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
    > >
    cjburkha, Jul 25, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Roland
    Replies:
    0
    Views:
    1,037
    Roland
    May 12, 2004
  2. Matthias
    Replies:
    5
    Views:
    406
    Whitecrest
    Jun 1, 2004
  3. Yannick

    ASP changes Big JPG -> Small JPG

    Yannick, Feb 2, 2004, in forum: ASP General
    Replies:
    6
    Views:
    141
    Tim Williams
    Feb 3, 2004
  4. Vilmar Brazão de Oliveira
    Replies:
    14
    Views:
    321
    Aaron Bertrand [MVP]
    Mar 5, 2004
  5. Replies:
    3
    Views:
    246
    Andy Dingley
    Sep 27, 2006
Loading...

Share This Page