Use asp.net to protect file types

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default Use asp.net to protect file types

    [url]http://support.microsoft.com/?id=815152[/url] (Edit the script mappings in
    Internet Services Mananger to protect pdf's with aspnet)


    I have a site that has multiple pdf's for download and multiple users
    who will download the .pdf's. I secured the site using the above
    article. I created an "admin" app that assigns users to .pdf's and I
    create links to the .pdf's based on that app.

    My problem is that once the user logs into the app. he has access to
    all the .pdf's if he simple types the URL in the address bar. I'm not
    sure the authentication "role" model with groups will work because I
    would need a group for each PDF and I would need to create the groups
    programmatically every time an "admin" adds a PDF to the "download"
    share.

    Thanks
    --Dietrich
    lawrence Guest

  2. Similar Questions and Discussions

    1. Can I password-protect a PDF file?
      I'm trying to set up a site with a 'members-only' area that contains PDF files. Is there some way to password-protect the files themselves, or do I...
    2. Protect file with different extension from .aspx
      Hi, I'm developing an asp.net application. I'm using form authentication. All runs with page aspx, but when I try to connect to a protected file...
    3. Can I Password-Protect Parts of a PDF File?
      Hello. I have Acrobat 6.0 Professional. I'd like to know if it's possible to create a password-protected PDF file that can limit viewing of...
    4. password protect an xml/rss file
      i need to assign an rss/xml file to each user this file will be accessed most likely through an rss aggregator (user/pass credentials for file)...
    5. password protect .fla file ?
      Hi all Is there a way for me to password protect my .fla and .swf files ? So that ? say someone comes up to my desktop, and is prompted for a...
  3. #2

    Default RE: Use asp.net to protect file types

    Dietrich,

    If you are following the article explicitly, any request for a PDF file
    will be processed through the HttpForbiddenHandler and any attempt to hit
    them will generate an error telling you that files of that type cannot be
    served. From what you are saying, it seems as though this is not what you
    want to do. Instead, you want to disallow hitting these files unless a
    user has met some requirement such as role membership. Is that correct?

    If that's the case, you should probably consider storing the PDFs outside
    of your content area and then using Response.BinaryWrite to stream the file
    assuming the user has permission to get it.

    Jim Cheshire [MSFT]
    Developer Support
    ASP.NET
    [email]jamesche@online.microsoft.com[/email]

    This post is provided as-is with no warranties and confers no rights.

    --------------------
    >From: [email]dwlawren@staff.uiuc.edu[/email] (lawrence)
    >Newsgroups: microsoft.public.dotnet.framework.aspnet.security
    >Subject: Use asp.net to protect file types
    >Date: 14 Oct 2003 15:09:19 -0700
    >Organization: [url]http://groups.google.com[/url]
    >Lines: 18
    >Message-ID: <aca0cbec.0310141409.1539524b@posting.google.com >
    >NNTP-Posting-Host: 130.126.240.97
    >Content-Type: text/plain; charset=ISO-8859-1
    >Content-Transfer-Encoding: 8bit
    >X-Trace: posting.google.com 1066169359 32629 127.0.0.1 (14 Oct 2003
    22:09:19 GMT)
    >X-Complaints-To: [email]groups-abuse@google.com[/email]
    >NNTP-Posting-Date: Tue, 14 Oct 2003 22:09:19 +0000 (UTC)
    >Path:
    cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed 00.sul.t-online.de!t-onlin
    e.de!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!postnew s1.google.com!no
    t-for-mail
    >Xref: cpmsftngxa06.phx.gbl
    microsoft.public.dotnet.framework.aspnet.security: 7165
    >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.security
    >
    >[url]http://support.microsoft.com/?id=815152[/url] (Edit the script mappings in
    >Internet Services Mananger to protect pdf's with aspnet)
    >
    >
    >I have a site that has multiple pdf's for download and multiple users
    >who will download the .pdf's. I secured the site using the above
    >article. I created an "admin" app that assigns users to .pdf's and I
    >create links to the .pdf's based on that app.
    >
    >My problem is that once the user logs into the app. he has access to
    >all the .pdf's if he simple types the URL in the address bar. I'm not
    >sure the authentication "role" model with groups will work because I
    >would need a group for each PDF and I would need to create the groups
    >programmatically every time an "admin" adds a PDF to the "download"
    >share.
    >
    >Thanks
    >--Dietrich
    >
    Jim Cheshire [MSFT] Guest

  4. #3

    Default Re: Use asp.net to protect file types

    Hello

    Please see my answer in this post
    [url]http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=362002[/url]

    It contains a solution for your problem

    Best regards

    Dinis Cruz
    ..Net Security Consultant
    DDPlus ([url]www.ddplus.net[/url])

    [email]dwlawren@staff.uiuc.edu[/email] (lawrence) wrote in message news:<aca0cbec.0310141409.1539524b@posting.google. com>...
    > [url]http://support.microsoft.com/?id=815152[/url] (Edit the script mappings in
    > Internet Services Mananger to protect pdf's with aspnet)
    >
    >
    > I have a site that has multiple pdf's for download and multiple users
    > who will download the .pdf's. I secured the site using the above
    > article. I created an "admin" app that assigns users to .pdf's and I
    > create links to the .pdf's based on that app.
    >
    > My problem is that once the user logs into the app. he has access to
    > all the .pdf's if he simple types the URL in the address bar. I'm not
    > sure the authentication "role" model with groups will work because I
    > would need a group for each PDF and I would need to create the groups
    > programmatically every time an "admin" adds a PDF to the "download"
    > share.
    >
    > Thanks
    > --Dietrich
    Dinis Cruz Guest

Posting Permissions

  • You may not post new threads
  • You may 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