Hi,
I am getting similar exception, while trying to rename the file on SFTP server.
My current code performs an upload as tmp file and then rename it as actual file once the upload is complete.
Currently I am checking rename if it fails not to delete the file locally.But Because of this we are having data duplication. So essntially Rename method is renaming but failing later!
currently using as below
if(!Rename(filefrom,fileto)
{
Delete local file
}
else
{
Renaming failed dont delete the file
}
Error messages apppearing during rename are as below:
**Renaming of file failed exception :System.InvalidOperationException: Not authenticated to the server.
Or
Renaming of file failed exception :Rebex.Net.SftpException: Cannot perform requested operation in current session state. ---> Rebex.Net.SshException: Cannot perform requested operation in current session state. ---> Rebex.Net.SshException: Cannot perform requested operation in current session state.**
Are there any known problems for Rename method?
Regards,
Bindu