webclient.downloadfile

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

  1. #1

    Default webclient.downloadfile

    I've been toying with an asp.net diretory browser and have been trying to
    use system.net.webclient.downloadfile as a means to download files from the
    webserver to the local machine. However access to all paths isn't valid
    (for obvious security reasons). Is there a work around for this, or a means
    that the end user can setup the destination directory without having to
    worry about access violations?

    Thanks in advance!




    Access to the path "c:\dohaa.htm" is denied.


    Exception Details: System.UnauthorizedAccessException: Access to the path
    "c:\dohaa.htm" is denied.

    ASP.NET is not authorized to access the requested resource. Consider
    granting access rights to the resource to the ASP.NET request identity.
    ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or
    Network Service on IIS 6) that is used if the application is not
    impersonating. If the application is impersonating via <identity
    impersonate="true"/>, the identity will be the anonymous user (typically
    IUSR_MACHINENAME) or the authenticated request user.

    To grant ASP.NET write access to a file, right-click the file in Explorer,
    choose "Properties" and select the Security tab. Click "Add" to add the
    appropriate user or group. Highlight the ASP.NET account, and check the
    boxes for the desired access.



    jared Guest

  2. Similar Questions and Discussions

    1. Webclient w/ Proxy
      I have a WebClient.OpenRead that is timing out on some client machines. I believe the problem may be Proxy settings on the client machine. How...
    2. DefaultCredentials and WebClient
      I'm trying to make a call inside an ASP.NET web application to an external quasi-web service (aka FrontPage Server Extensions): Dim rpcClient As...
    3. WebClient.DownloadData without cache
      I am using WebClient to download a text file from the net every 2 minutes. The problem is that I think I am reading the file from cache since when...
    4. CookieContainer with WebClient
      Any help appreciated ... I am trying to connect to a site that requires authentication through cookies, and be able to navigate through several...
    5. WebClient Problem
      hi, i using WebClient to get the website. like string URL = "http://127.0.0.1/index.htm"; WebClient client = new WebClient(); Stream data =...
  3. #2

    Default Re: webclient.downloadfile

    jared wrote:
    > I've been toying with an asp.net diretory browser and have been
    > trying to use system.net.webclient.downloadfile as a means to
    > download files from the webserver to the local machine. However
    > access to all paths isn't valid (for obvious security reasons). Is
    > there a work around for this, or a means that the end user can setup
    > the destination directory without having to worry about access
    > violations?
    You always have to "worry" about security ;-)

    There are basically two choices: Make as many directories as required
    accessible to the ASPNET user (ouch!) or use impersonation so that ASP.NET
    uses the identity provided by the client. I guess the latter makes more
    sense for a web-based file browser, since all appropriate access rights
    should already be in place.

    Cheers,

    --
    Joerg Jooss
    [url]www.joergjooss.de[/url]
    [email]news@joergjooss.de[/email]


    Joerg Jooss 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