Preventing access to all file types in a directory using ASP.NET

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

  1. #1

    Default Preventing access to all file types in a directory using ASP.NET

    Is it possible to prevent access to all files in a (virtual) directory using
    ASP.NET and without using an ISAPI filter? I'm quite happy using the standard
    classes for authentication and authorisation for ASP.NET (.aspx) pages, but I
    want to stop unauthorised users accessing plain HTML pages, PDF files and SWF
    files in a directory as well. Can I use HTTPModule for this? Basically, I
    want to interrogate and filter all requests in a particular directory, but I
    don't want to have to learn C++ just to complete this piece of work.
    nickk Guest

  2. Similar Questions and Discussions

    1. Server cannot access application directory ... The directory does not exist or is not accessible because of security settings
      If you are using Windows XP in a Workgroup, rather than a Domain, then by default "Simple Filesharing" is turned on, and you won't see a security...
    2. Access to workstations file directory
      Hi there, Can anyone help with the following: I want a user to be able to click on a button (import image) then be presented with the normal...
    3. PHP file access and directory security
      I have a directory protected with .htaccess / .htpasswd. After I'm validated, I run a php script which bombs out when trying to write a file to...
    4. preventing USB hdd access
      I have the same query Joe. Has anyone found a solution for this issue of wanting to prevent access to storage devices via the USB ports? ...
    5. Security: Preventing direct access to a PDF file
      but if a user ,who has right to log in ,opened the pdf and know the url of this pdf,then he tell this url to others ,who has no right to log in,so...
  3. #2

    Default Re: Preventing access to all file types in a directory using ASP.NET

    Use Wildcard application maps to pass everything through the asp.net
    framework dll and then use a http module or suitable authorization
    mechanism written in asp.net.
    This is a good example.
    [url]http://www.eggheadcafe.com/articles/20040317.asp[/url]

    nickk wrote:
    > Is it possible to prevent access to all files in a (virtual)
    directory using
    > ASP.NET and without using an ISAPI filter? I'm quite happy using the
    standard
    > classes for authentication and authorisation for ASP.NET (.aspx)
    pages, but I
    > want to stop unauthorised users accessing plain HTML pages, PDF files
    and SWF
    > files in a directory as well. Can I use HTTPModule for this?
    Basically, I
    > want to interrogate and filter all requests in a particular
    directory, but I
    > don't want to have to learn C++ just to complete this piece of work.
    ekeenan@gmail.com Guest

  4. #3

    Default Re: Preventing access to all file types in a directory using ASP.NET

    What I have done is very very simple, it may or may not apply to your
    situation. This is the article that I found that worked for me.
    [url]http://www.derkeiler.com/Newsgroups/microsoft.public.dotnet.framework.aspnet.security/2003-03/0151.html[/url]

    I added a couple application extensions just like the article said and it
    worked great. Very easy fix.


    "nickk" <nickk@discussions.microsoft.com> wrote in message
    news:559C4C64-1BF3-4EF0-94A4-44A54C7FD5A4@microsoft.com...
    > Is it possible to prevent access to all files in a (virtual) directory
    using
    > ASP.NET and without using an ISAPI filter? I'm quite happy using the
    standard
    > classes for authentication and authorisation for ASP.NET (.aspx) pages,
    but I
    > want to stop unauthorised users accessing plain HTML pages, PDF files and
    SWF
    > files in a directory as well. Can I use HTTPModule for this? Basically, I
    > want to interrogate and filter all requests in a particular directory, but
    I
    > don't want to have to learn C++ just to complete this piece of work.

    Andy G 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