Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > File upload to a remote share not working.

Reply
Thread Tools

File upload to a remote share not working.

 
 
rajesh
Guest
Posts: n/a
 
      06-08-2004
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


 
Reply With Quote
 
 
 
 
Jared
Guest
Posts: n/a
 
      06-08-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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
>
>



 
Reply With Quote
 
 
 
 
Steve C. Orr [MVP, MCSD]
Guest
Posts: n/a
 
      06-08-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
rajesh
Guest
Posts: n/a
 
      06-08-2004
Thank you. That works.


"Jared" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> >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
> >
> >

>
>



 
Reply With Quote
 
rajesh
Guest
Posts: n/a
 
      06-08-2004
Thank you. That works.

"Steve C. Orr [MVP, MCSD]" <(E-Mail Removed)> wrote in message
news:OoZu6%(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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
> >
> >

>
>



 
Reply With Quote
 
tinhtam tinhtam is offline
Junior Member
Join Date: Nov 2007
Posts: 3
 
      11-15-2007
Could anyone help me out with setting the permission so that I can upload file to a remote share? Thank you.

Tinhtam
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Share-Point-2010 ,Share-Point -2010 Training , Share-point-2010Hyderabad , Share-point-2010 Institute Saraswati lakki ASP .Net 0 01-06-2012 06:39 AM
question DRb class definition share or not share Jack Ruby 2 10-11-2007 05:26 PM
Upload a file without file Upload control - ASP.Net =?Utf-8?B?U2FyYXY=?= ASP .Net 3 08-03-2005 01:09 AM
Remote Assistance fails to connect, remote remote host name could not be resolved Peter Sale Wireless Networking 1 12-11-2004 09:09 PM
How to detect sizeof upload in order to show status of browser file upload? Heather Fraser Java 0 07-05-2004 12:35 AM



Advertisments