473,385 Members | 1,192 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,385 software developers and data experts.

File upload to a remote share not working.

I am trying to upload a file using .Net's HttpPostedFile.SaveAs() to a share
on a remote server. It works fine when the share is on the same server. I
looked at the permissions on the share and they all seem to be set properly.
These permission setting are the same as what was used when we were
uploading the files using the old asp code.

Given below is the stack trace

Message:
Could not find a part of the path "\\Server01\Attachments$".

Source:
mscorlib

Stack Trace:
at System.IO.__Error.WinIOError(Int32 errorCode, String str)
at System.IO.Directory.InternalCreateDirectory(String fullPath, String
path)
at System.IO.Directory.CreateDirectory(String path)

Thank you
Rajesh
Nov 18 '05 #1
4 3224
I had the same problem a week or two ago, the answer is impersonation vs.
delegation. That is why it works on the web server but not the remote share.
If you set your web site to basic authentication and have the user type in
domainname\username & password they should be able to upload and save files,
it just doesn't seem to work with windows authentication. Read the below
article.
Jared

http://msdn.microsoft.com/library/de...delegation.asp
"rajesh" <ra****@healinx.com> wrote in message
news:Ob**************@TK2MSFTNGP09.phx.gbl...
I am trying to upload a file using .Net's HttpPostedFile.SaveAs() to a
share
on a remote server. It works fine when the share is on the same server. I
looked at the permissions on the share and they all seem to be set
properly.
These permission setting are the same as what was used when we were
uploading the files using the old asp code.

Given below is the stack trace

Message:
Could not find a part of the path "\\Server01\Attachments$".

Source:
mscorlib

Stack Trace:
at System.IO.__Error.WinIOError(Int32 errorCode, String str)
at System.IO.Directory.InternalCreateDirectory(String fullPath, String
path)
at System.IO.Directory.CreateDirectory(String path)

Thank you
Rajesh

Nov 18 '05 #2
The default ASPNET user account that ASP.NET uses does not have network
permissions by default. Either give the account such permissions or use
impersonation to have it run under a different account that does have such
permissions. For testing purposes you can have it run under your personal
user account.
Here's more info:
http://msdn.microsoft.com/library/de...ersonation.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"rajesh" <ra****@healinx.com> wrote in message
news:Ob**************@TK2MSFTNGP09.phx.gbl...
I am trying to upload a file using .Net's HttpPostedFile.SaveAs() to a share on a remote server. It works fine when the share is on the same server. I
looked at the permissions on the share and they all seem to be set properly. These permission setting are the same as what was used when we were
uploading the files using the old asp code.

Given below is the stack trace

Message:
Could not find a part of the path "\\Server01\Attachments$".

Source:
mscorlib

Stack Trace:
at System.IO.__Error.WinIOError(Int32 errorCode, String str)
at System.IO.Directory.InternalCreateDirectory(String fullPath, String
path)
at System.IO.Directory.CreateDirectory(String path)

Thank you
Rajesh

Nov 18 '05 #3
Thank you. That works.

"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:Oo****************@TK2MSFTNGP11.phx.gbl...
The default ASPNET user account that ASP.NET uses does not have network
permissions by default. Either give the account such permissions or use
impersonation to have it run under a different account that does have such
permissions. For testing purposes you can have it run under your personal
user account.
Here's more info:
http://msdn.microsoft.com/library/de...ersonation.asp
--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"rajesh" <ra****@healinx.com> wrote in message
news:Ob**************@TK2MSFTNGP09.phx.gbl...
I am trying to upload a file using .Net's HttpPostedFile.SaveAs() to a

share
on a remote server. It works fine when the share is on the same server. I looked at the permissions on the share and they all seem to be set

properly.
These permission setting are the same as what was used when we were
uploading the files using the old asp code.

Given below is the stack trace

Message:
Could not find a part of the path "\\Server01\Attachments$".

Source:
mscorlib

Stack Trace:
at System.IO.__Error.WinIOError(Int32 errorCode, String str)
at System.IO.Directory.InternalCreateDirectory(String fullPath, String
path)
at System.IO.Directory.CreateDirectory(String path)

Thank you
Rajesh


Nov 18 '05 #4
Thank you. That works.
"Jared" <VB***********@email.com> wrote in message
news:10*************@corp.supernews.com...
I had the same problem a week or two ago, the answer is impersonation vs.
delegation. That is why it works on the web server but not the remote share. If you set your web site to basic authentication and have the user type in
domainname\username & password they should be able to upload and save files, it just doesn't seem to work with windows authentication. Read the below
article.
Jared

http://msdn.microsoft.com/library/de...delegation.asp

"rajesh" <ra****@healinx.com> wrote in message
news:Ob**************@TK2MSFTNGP09.phx.gbl...
I am trying to upload a file using .Net's HttpPostedFile.SaveAs() to a
share
on a remote server. It works fine when the share is on the same server. I looked at the permissions on the share and they all seem to be set
properly.
These permission setting are the same as what was used when we were
uploading the files using the old asp code.

Given below is the stack trace

Message:
Could not find a part of the path "\\Server01\Attachments$".

Source:
mscorlib

Stack Trace:
at System.IO.__Error.WinIOError(Int32 errorCode, String str)
at System.IO.Directory.InternalCreateDirectory(String fullPath, String
path)
at System.IO.Directory.CreateDirectory(String path)

Thank you
Rajesh


Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Dan V. | last post by:
Situation: I have to connect with my Windows 2000 server using VS.NET 2003 and C# and connect to a remote Linux server at another company's office and query their XML file. Their file may be...
1
by: PeterB | last post by:
Hi! I'm using Pure ASP File Upload (http://www.asp101.com/articles/jacob/scriptupload.asp) to upload a file from a client to a server. I am testing both on a local IIS and a remote server. The...
4
by: R Reyes | last post by:
I am trying to code a file uploader (for forum/email attachments) from the client computer to a remote web server via the PUT method (since POST is not allowed ). However, the upload works ONLY...
13
by: Sky Sigal | last post by:
I have created an IHttpHandler that waits for uploads as attachments for a webmail interface, and saves it to a directory that is defined in config.xml. My question is the following: assuming...
6
by: Pat Carden | last post by:
Hi, We need to allow webusers to upload a file on our website (on Server3, all servers run Server 2003, remotely hosted) and eventually save it on our SBS Server (Server2) which is not exposed...
18
by: Jen | last post by:
I'm using Microsoft's own VB.NET FTP Example: http://support.microsoft.com/default.aspx?scid=kb;en-us;832679 I can get the program to create directories, change directories, etc., but I can't...
6
by: leandra_s | last post by:
Hello I want to upload files to a server with asp. But the problem is that the server where my asp website stands is a different server then where my upload files must go. Is there a way to...
4
by: Vlad | last post by:
I am having problems using the file.create method within a function that is called when looping through an array of filepaths. If I call my function with a hardcoded file path --C:\Temp.txt the...
1
by: tanya.wang | last post by:
I want to access files from a remote server so I mapped it in my server under z:\ for \\myserver\web\mysite\images\ I added this UNC path to my IIS virtual directory and name it as "upload" but I...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.