Hi Lukas,
Thanks for your replay.
I write code for moving ftp folder, like :
private void MoveFtpFolder("TEST/040312", "BACKUP")
{
try
{
string strFtpCurrentDirectory = string.Empty;
string strNewFtpDir = string.Empty;
bool blFtpDirExists;
ftp.Connect(strFtpIp, iFtpPort);
ftp.Login(strFtpUsrname, strFtpPwd);
ftp.ChangeDirectory("");
strFtpCurrentDirectory = ftp.GetCurrentDirectory();
blFtpDirExists = ftp.DirectoryExists(strFtpBackupDir);
if (blFtpDirExists == true)
{
//ftp.ChangeDirectory("..");
//strFtpCurrentDir = ftp.GetCurrentDirectory();
ftp.Rename(strFtpCurrentDir, strFtpBackupDir);
}
else
{
strNewFtpDir = ftp.CreateDirectory(strFtpBackupDir);
//ftp.ChangeDirectory("..");
//strFtpCurrentDir = ftp.GetCurrentDirectory();
ftp.Rename(strFtpCurrentDir, strNewFtpDir);
}
ftp.Disconnect();
}
catch (Exception ex)
{
Trace.WriteLine(ex);
}
}
and i am getting exception like :
Rebex.Net.FtpException: /g:/srinu/BACKUP: Unable to rename file or directory (553).
at Rebex.Net.Ftp.1SAJuN(Int32 , Boolean )
at Rebex.Net.Ftp.1SAJuN(Int32 )
at Rebex.Net.Ftp.Rename(String fromPath, String toPath)
at UploadFiles.frmUpload.MoveFtpFolder(String strFtpCurrentDir, String strFtpBackupDir)
help me to resolve this issue.
Thanks
Srinu