Rename/Move File in SFTP Server (General questions)
While using rename method of SFTPDlxCom if file with same name already exists it throws the error. Is it possible to override the default behaviour to overwrite the existing file while renaming/moving?
Re: Rename/Move File in SFTP Server
Anyz,
actually, client is hopeless here. All we can do is follow your command - try to rename the file. We don't know what will server do, we don't know server's environment, we don't know if files exist etc.. So, we cannot give any special commands to the server, or do any commands before we initiate Rename/Move. For Rename/Move, server accepts only 2 arguments - old and new name - so there's not more than that we can do.
It's all up to the server to decide what it will do with our Rename/Move request.
Kreso
Re: Rename/Move File in SFTP Server
Anyone know how to trap the error in ASP on a webserver ?
I have tried the rename method but when the destination file cannot be overwritten lasterror still is 0..
so there is no way to detect this
Re: Rename/Move File in SFTP Server
Raymond,
are you sure about this? If method isn't successful, server would return an error which will be redirected to you through LastError property. Perhaps it was successful so LastError=0?
How can we duplicate it?
Re: Rename/Move File in SFTP Server
If I try to rename a file that doesn't exist on the server it doesn't give an error.
We are still using version: 2.3.0.3 could this be the problem
Re: Rename/Move File in SFTP Server
I just tried this in SFTP protocol, command like this:
Ftp1.Rename bleh , /home/joe/blah
returned 30018 (which is correct). I also tried (just in case)
Ftp1.Rename /home/joe/bleh , /home/joe/blah
and same error was returned. Obviously, none of these files actually exist.