Professional Web Applications Themes

Password protect .jpg or .pdf - ASP.NET Security

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 ...

  1. #1

    Default Password protect .jpg or .pdf

    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 Guest

  2. #2

    Default Re: Password protect .jpg or .pdf

    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" <com> wrote in message
    news:googlegroups.com... 


    Joe Guest

  3. #3

    Default Re: Password protect .jpg or .pdf

    Great, thank you for that tip.
    Joe Kaplan (MVP - ADSI) wrote: [/ref]

    cjburkha Guest

Similar Threads

  1. password protect
    By crazy-eyes1 in forum Dreamweaver AppDev
    Replies: 4
    Last Post: July 6th, 10:32 AM
  2. Replies: 5
    Last Post: January 8th, 08:36 PM
  3. protect password without SSL
    By viviana in forum ASP.NET Security
    Replies: 1
    Last Post: July 31st, 07:14 PM
  4. Password protect IE
    By cuijiu in forum Windows Setup, Administration & Security
    Replies: 0
    Last Post: June 29th, 07:18 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139