File copy via ASP.NET access errors?

S

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
 
K

Ken Schaefer

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,527
Members
44,998
Latest member
MarissaEub

Latest Threads

Top