Groups > Web Hosting > IIS FTP > Unable to FTP Upload




Unable to FTP Upload

Unable to FTP Upload
Sun, 20 Aug 2006 15:46:44 +000
Hi, this is my official first post, so please be gentle if I've forgotten
anything.

I have to upload a file onto a Linux server.  

I can connect to the server via windows explorer, ftp.exe, and any ftp client. 
The user has permissions on all the folders, and I can manually upload files and
download files, change directories and pretty much do any operation on the Linux
implementation.  I say again, the user has permissions, and I have double,
triple, and quadruple checked the permissions.

I'm trying to send files to the build box:

publicvoid SendFileToBuildBox(FileInfo file) 

{

string uriString = "ftp://10.160.20.xx/home/sigbld/request/test.txt";


WebClient request = newWebClient(); 

request.BaseAddress = "ftp://10.160.20.xx/home/sigbld/request/"; 

try

{

request.UseDefaultCredentials = false; 

NetworkCredential credents = newNetworkCredential(FTP_BUILD_USER,
FTP_BUILD_PASS); 

request.Credentials = credents;

byte[] serverResponse = request.UploadFile(uriString,
"STOR","C:\\idswkflow\\export\\Test.txt"); 

}

catch (WebException ex) 

{

string Status = ((FtpWebResponse)ex.Response).StatusDescription; 

ex.HelpLink = Status;

throw ex; 

}



}

 

When I run the method, it catches the WebException "ex" and the
StatusDescription Reads:

"550 Failed to change directory"

Is there something the new .NET 2.0 implementation does to change directories
that is different from the FTP.exe method?   Anyone have any insight on why
programmatically connecting and changing the directory is different than using
the ftp.exe or IE methods (Which both work).  Solutions?  

 

Thanks a bunch
Post Reply
about | contact