By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,838 Members | 1,623 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,838 IT Pros & Developers. It's quick & easy.

File copy via ASP.NET access errors?

P: n/a
Stu
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

Nov 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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:
http://msdn.microsoft.com/library/de...l/secmod05.asp

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

HTH,

--
Scott
http://www.OdeToCode.com
On Sat, 31 Jul 2004 21:57:18 -0600, "Stu" <St*@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


Nov 18 '05 #2

P: n/a
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" <St*@thynk.us> wrote in message
news:Op**************@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

Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.