Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
12k views
in Java FTP by (320 points)
Hi,

Is it possible for file move within the same FTP/SFTP server with editFTPj/PRO Version 2.1.0.
If so, please provide me the code.


Thanks in advance,
Regards,
Safraz

4 Answers

0 votes
by (162k points)
It depends on the server - try renaming it (using the old path, and the new path).
0 votes
by (320 points)
i have used

ftp.rename("test.txt", "date\test.txt");

I'm getting following exception;

com.enterprisedt.net.ftp.FTPException: RNTO failed...
at com.enterprisedt.net.ftp.FTPControlSocket.validateReply(Unknown Source)
at com.enterprisedt.net.ftp.FTPClient.rename(Unknown Source)
at lk.informatics.editftpj.ftp.FTPTest.main(FTPTest.java:55)
INFO [FTPControlSocket] 27 Oct 2008 14:10:38.062 : Expected reply code = [250]


Any Suggestion?
0 votes
by (162k points)
Try using the full paths:

ftp.rename("/home/usr/abc/test.txt", "/home/usr/date/test.txt");

where of course you need to use the correct paths.

You can find out the paths by using a command line client and typing 'pwd'

Not all FTP servers permit the above, but many do.
0 votes
by (320 points)
It works with the absolute path

Thanks for your quick reply

Categories

...