Click to See Complete Forum and Search --> : C#:Upload File to different server from web server??HELP


brayant
02-01-2007, 09:30 PM
Hi All,

I have problem with the upload the file to the diffrent server with the web application server. How to write the File1.PostedFile.SaveAs()????? to located to other server.

IF the normal case for upload is to own server same with the web application the code is below
//string FilePath="c:\\Inetpub\\wwwroot\\Nanya\\Upload\\";
File1.PostedFile.SaveAs(FilePath+"KTCMA\\"+myFile);

BUT for my case i want to upload my file to the server that not same as my web application that means my web application is at Server A but i want upload my file to Server B from Server A
and i write the code below

string FilePath="\\Server B\\C$\\Inetpub\\wwwroot\\Nanya\\Upload\\";
File1.PostedFile.SaveAs(FilePath+"KTCMA\\"+myFile);

and the error is "Cant find the part of C:\ServerB\C$\Inetpub\wwwroot\Nanya\Upload\"

Any one can help me urgent??

Orc Scorcher
02-02-2007, 05:18 AM
Looks like you're missing a backslash, try
string FilePath = @"\\Server B\C$\Inetpub\wwwroot\Nanya\Upload\";

brayant
02-05-2007, 02:12 AM
Now the problem is the \\Server B\C$\Inetpub\wwwroot\Nanya\Upload\XX.txt\ path is access denied
i think is the security issue
So how can i make right access to the ServerB when our web application located at Server A. What should make the right access to the Server B?
What user need to ADD at server B ??
HELP HELP
Thanks.