File copy via ASP.NET access errors?

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

  1. #1

    Default File copy via ASP.NET access errors?

    Using IIs 6.0 on a Server 2003 box, and using ASP.NET I'm trying to do the
    following code snippit...
    Dim NewName As String = "\\network_share_path\edit_me.ppt"

    Dim PubName As String = "\\network_share_path\show_me.ppt"

    Dim PubFile As System.IO.File

    If PubFile.Exists(PubName) Then

    PubFile.Move(PubName, PubName + "BAK" + Format(Now, "hhmmss-MMddyyyy"))

    End If

    PubFile.Copy(NewName, PubName)



    to replace one file that is displayed on a monitor with another that has
    been edited. I get System.UnauthorizedAccessException errors. the
    \\network_share_path\ is on a different server on the same domain.
    Impsonate = true is set in the web.config file. I've also tried
    \\IIsserver\shared_path\show_me.ppt , since I don't have admin on the
    \\network_share_path\ machine but I do on the IIs server. I've tried using
    absolute paths and relative paths on the server. I've checked the
    permissons both on the share side and the file path side (on the IIS
    machine) and even tried tossing the EVERYONE account with full control. I
    tried adding the share as a virtual directory and assigning write
    permissions to the ASP.NET page.

    Got me stumped, about out of ideas of what else to try.

    Thanks in Advance!

    Stu



    Stu Guest

  2. Similar Questions and Discussions

    1. Access undefined errors
      Hi everyone, I am new to Flex and I was trying to do a simple for loop and I keep getting this error: Error Access of undefined property. Here...
    2. Copy a table in Access structure only with CF query
      Hello, I need to know how to create a new table by copying an existing table with the table structure only in a query Don't know the Syntax but...
    3. Adding Access DB Errors
      trying to add an access db, but it only offers me Microsoft SQL Server, SQL 3.x and "other" as options for db types to add - i'm not used to this...
    4. Access denied errors
      I have been getting some rather confusing access errors when trying to use an asp page to access my Access database. I have all the security...
    5. db errors in access
      Good Morning, I have created a database and the forms to run it solely in access and it has been stored on my office's networked drive. I also...
  3. #2

    Default Re: File copy via ASP.NET access errors?

    Hi Stu:

    Standard windows authentication doesn't make more than one hop across
    the network - when you impersonate the user on the web server that
    context won't flow to the machine with the network share unless you
    enable delegation.

    There are some more details here:
    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/secmod/html/secmod05.asp[/url]

    Another option is to run your application under a domain account with
    access to the network share.

    HTH,

    --
    Scott
    [url]http://www.OdeToCode.com[/url]


    On Sat, 31 Jul 2004 21:57:18 -0600, "Stu" <Stu@thynk.us> wrote:
    >Using IIs 6.0 on a Server 2003 box, and using ASP.NET I'm trying to do the
    >following code snippit...
    >Dim NewName As String = "\\network_share_path\edit_me.ppt"
    >
    >Dim PubName As String = "\\network_share_path\show_me.ppt"
    >
    >Dim PubFile As System.IO.File
    >
    >If PubFile.Exists(PubName) Then
    >
    > PubFile.Move(PubName, PubName + "BAK" + Format(Now, "hhmmss-MMddyyyy"))
    >
    >End If
    >
    >PubFile.Copy(NewName, PubName)
    >
    >
    >
    >to replace one file that is displayed on a monitor with another that has
    >been edited. I get System.UnauthorizedAccessException errors. the
    >\\network_share_path\ is on a different server on the same domain.
    >Impsonate = true is set in the web.config file. I've also tried
    >\\IIsserver\shared_path\show_me.ppt , since I don't have admin on the
    >\\network_share_path\ machine but I do on the IIs server. I've tried using
    >absolute paths and relative paths on the server. I've checked the
    >permissons both on the share side and the file path side (on the IIS
    >machine) and even tried tossing the EVERYONE account with full control. I
    >tried adding the share as a virtual directory and assigning write
    >permissions to the ASP.NET page.
    >
    >Got me stumped, about out of ideas of what else to try.
    >
    >Thanks in Advance!
    >
    >Stu
    >
    >
    Scott Allen Guest

  4. #3

    Default Re: File copy via ASP.NET access errors?

    Hi,

    Where are the user credentials coming from? If you have hard coded them into
    the <impersonate> web.config setting, then are you using a domain account?

    On the other hand, if you are getting the user to supply the credentials,
    then you will need to use Basic Authentication if you do not want to enable
    Delegation. Basic Authentication means that IIS has the user's
    username/password in clear text, and can directly impersonate the user to
    get access to remote resources.

    Any other auth type (Digest, Integrated etc) means that IIS merely has an
    access token that doesn't have permissions (by default) to logon to remote
    resources. If you ensure that the client is authenticating using Kerberos,
    you can enable delegation, and thus allow IIS to get a service ticket on
    behalf of the user to access the remote resource. If you want to go down
    this path, please let us know, and I'll post some instructions.

    Cheers
    Ken


    "Stu" <Stu@thynk.us> wrote in message
    news:OpGYNv3dEHA.1644@tk2msftngp13.phx.gbl...
    > Using IIs 6.0 on a Server 2003 box, and using ASP.NET I'm trying to do the
    > following code snippit...
    > Dim NewName As String = "\\network_share_path\edit_me.ppt"
    >
    > Dim PubName As String = "\\network_share_path\show_me.ppt"
    >
    > Dim PubFile As System.IO.File
    >
    > If PubFile.Exists(PubName) Then
    >
    > PubFile.Move(PubName, PubName + "BAK" + Format(Now,
    "hhmmss-MMddyyyy"))
    >
    > End If
    >
    > PubFile.Copy(NewName, PubName)
    >
    >
    >
    > to replace one file that is displayed on a monitor with another that has
    > been edited. I get System.UnauthorizedAccessException errors. the
    > \\network_share_path\ is on a different server on the same domain.
    > Impsonate = true is set in the web.config file. I've also tried
    > \\IIsserver\shared_path\show_me.ppt , since I don't have admin on the
    > \\network_share_path\ machine but I do on the IIs server. I've tried
    using
    > absolute paths and relative paths on the server. I've checked the
    > permissons both on the share side and the file path side (on the IIS
    > machine) and even tried tossing the EVERYONE account with full control. I
    > tried adding the share as a virtual directory and assigning write
    > permissions to the ASP.NET page.
    >
    > Got me stumped, about out of ideas of what else to try.
    >
    > Thanks in Advance!
    >
    > Stu
    >
    >
    >

    Ken Schaefer 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