Hi,
I'm trying to make an app that will upload files on a ftp server but I keep getting this error 550 Can't change directory to (dir name): No such file or directory. I've checked the path and it's good.
Can someone tell me how to correct this ? I've tested my code on a local server and it works. What am I missing ?
2 replies to this topic
#1
Posted 27 April 2011 - 07:49 AM
|
|
|
#2
Posted 27 April 2011 - 09:16 AM
If you could post some of the code you're using then it will be easier to help you out.
Sounds like either your 2 ftp servers are configured differently maybe you need to use absolute, instead of relative paths when changing directory.
That's all i can guess given the facts at hand
Cheers
Sounds like either your 2 ftp servers are configured differently maybe you need to use absolute, instead of relative paths when changing directory.
That's all i can guess given the facts at hand
Cheers
#3
Posted 27 April 2011 - 09:32 AM
wwarren said:
If you could post some of the code you're using then it will be easier to help you out.
Sounds like either your 2 ftp servers are configured differently maybe you need to use absolute, instead of relative paths when changing directory.
That's all i can guess given the facts at hand
Cheers
Sounds like either your 2 ftp servers are configured differently maybe you need to use absolute, instead of relative paths when changing directory.
That's all i can guess given the facts at hand
Cheers
FtpWebRequest request = (FtpWebRequest)WebRequest.Create(new Uri ("ftp://" + ftpAddress + "/" + fileName));
request.Method = WebRequestMethods.Ftp.UploadFile;
request.Credentials = new NetworkCredential("roxy", "roxana");
request.UsePassive = true;
request.UseBinary = true;
request.KeepAlive = true;
request.Proxy = null;
Stream ftpStream = request.GetRequestStream();
FileStream file = File.OpenRead("d:\\Test_Upload.txt");
int len = 1024;
byte[] buffer = new byte[len];
int bytesRead = 0;
do
{
bytesRead = file.Read(buffer, 0, len);
ftpStream.Write(buffer, 0, bytesRead);
}
while (bytesRead != 0);
file.Close();
ftpStream.Close();
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account

Back to top









