Archived Forum Post

Index of archived forum posts


Chilkat C# SFTP Move Files from SFTP Directory to Another.

Jan 28 '16 at 08:07

Heey everyone.

I have a problem with my Code, that i cant move files from one directory/Folder to another. I have uploaded files there is laying in the /HOME/, and i need to move the same files from /Home/ to /Upload/ instead. I have tried the SFTP.RenamefileorDir. but it wont Work and i just get an Permission Declined. i have tried login the server just with an SFTP client. and i can easy move the files from there. But if i use my program in C# i get Permission declined, Anyone have an idea what this that be and maybe a advice on what i can do now :)


Your SFTP user account probably has access restricted to the directory tree starting in the HOME directory and below.

In general, it's virtually impossible for others to help with "permission denied" because the error it is caused by the file and directory ownership and permissions on the server, in combination with the permissions configured for the particular SSH user account (on your particular "brand" of SSH server -- whether it be OpenSSH or a commercial server, and the features for setting up and configuring user accounts are specific to the SSH server implementation and not part of any protocol).

So in general, only the systems administrator (which may be the developer himself), is privy to the information required to understand the cause of the problem..


However, if I understand what he says correctly, when he used another SFTP client, he was able to move the files, just not through his code using Chilkat library which appears to clear any issues with permissions.


Thanks! I'm glad to hear the problem is solved. I should've mentioned previously (and I'm sorry I didn't) that it's good to examine the contents of the LastErrorText with VerboseLogging turned on. Usually the LastErrorText will emit the values of the method args it receives so that one can check to see if the actual values passed to a Chilkat method are the expected ones.