473,386 Members | 1,823 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

File copy via ASP.NET access errors?

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
2 3556
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Brian K. | last post by:
I am trying to split up and secure a database that we've been using on a network for a few years, following the procedure listed in Q304932 from microsoft. I create a new blank database for...
4
by: Grant Austin | last post by:
Hello, This might be a tad off topic. The c-programming groups I found appear to be unused... The problem is simple... I need to create a listing file from an assembler source file. The...
4
by: Mountain Bikn' Guy | last post by:
I am having serious problems with the following IDE bug: Could not write to output file 'x.dll' -- 'The process cannot access the file because it is being used by another process. ' and BUG:...
8
by: Sarah | last post by:
I need to access some data on a server. I can access it directly using UNC (i.e. \\ComputerName\ShareName\Path\FileName) or using a mapped network drive resource (S:\Path\FileName). Here is my...
68
by: Martin Joergensen | last post by:
Hi, I have some files which has the following content: 0 0 0 0 0 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 0 0 0 0 0 0 0
1
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
9
by: JimmyKoolPantz | last post by:
IDE: Visual Studio 2005 Language: VB.NET Fox Pro Driver Version: 9.0.0.3504 Problem: I currently have a problem altering a DBF file. I do not get any syntax errors when running the program. ...
7
by: Adam | last post by:
Hello. I do most of my web dev work from a Mac (whose file system is case-insensitive.) I upload my web pages and other files onto a Unix-based host, which is case sensitive. When I look at the...
2
by: Visine_Eyes | last post by:
What .NET mechanism should I use to resolve permission issues before I begin to copy directory structure/file(s) from one computer to another. I have tried Try/Catch statement using DirectoryInfo...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.