Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
2.2k views
in .NET FTP by
Hello,

I have problem with rename files on some ftp servers.

Example:

I tried rename file: /path/name.txt
I used ftp.rename("/path/name.txt", "newname.txt")

Server1:
>result: /path/newname.txt

Server2:
>result: /newname.txt

Then I tried use ftp.rename("/path/name.txt", "/path/newname.txt")

Server1:
>result: exception 'To' must be a filename, not a path.

Server2:
>result: /path/newname.txt

Any Idea?

Thank you.

P.S.: edtftp.dll is really great, good work!

1 Answer

0 votes
by (51.2k points)
It sounds like the FTP server only supports renaming of files within the working directory. Please try CDing into the directory first and then renaming without specifying the path-name. That is:
ftpClient.chdir("path");
ftpClient.rename("name.txt", "newname.txt");


- Hans (EDT Support)

Categories

...