Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
4.6k views
in .NET FTP by (200 points)
Hi All,

any body tell me that how to move files form one folder to another folder in ftp

Regards,
Srinu

5 Answers

0 votes
by (51.6k points)
Try using RenameFile.

- Hans (EnterpriseDT)
0 votes
by (200 points)
Hi Support Team,
Thanks for Quick repaly.

i have tryed with RenameFile method but its getting error.

i wrote the code as fallows....

ftpConnection1.RenameFile(filesListBox.SelectedItem.ToString(), ("/backup/" + filesListBox.SelectedItem.ToString()));

what wrong with above method.

source directory: abc/test.txt (in ftp client)

destination directory: abc/backup/test.txt (in ftp client)

Thanks in Advance,
Srinu
0 votes
by (162k points)
Enable logging and let us know what the error is. Your server may not support moving the file between directories.
0 votes
by (200 points)
Hi,

EnterpriseDT.Net.Ftp.FTPException: Permission denied. (code=550)
at EnterpriseDT.Net.Ftp.FTPControlSocket.ValidateReply(FTPReply reply, String[] expectedReplyCodes)
at EnterpriseDT.Net.Ftp.FTPClient.Rename(String from, String to)
at EnterpriseDT.Net.Ftp.FTPConnection.RenameFile(String from, String to)
at FtpClientActions.frmDownload.btnDownload_Click(Object sender, EventArgs e) in D:\FtpClientActions\FtpClientActions\frmDownload.cs:line 106

This error iam getting. i don't know how to write logging.

so iam sending trace message.

Thanks,
Srinu
0 votes
by (51.6k points)
Hi Srinu

That error is not very informative but it probably indicates that you (1) don't have permission to rename files at all or (2) don't have permission to either read in the source file or write in the target file. The server logs may tell you more. Also try to upload a file directly to the target directory to see if you have write permission there.

- Hans (EnterpriseDT)

Categories

...