Upload File to the root directory doesn't work

Advertisement

vandyke
Guest

Upload File to the root directory doesn't work

Hello,

I have problems with uploading a single file to the root of an sftp server. There is no problem to upload the file to an existing directory, but not to the root.

I tried:
DnSession.PutFiles(DocFileName, FtpRemotePath, FALSE, DnTransferOptions);

where FtpRemotPath is "/"

I also tried: "./", "", and session.HomePath + "/" like mentioned here: https://stackoverflow.com/questions/26971992/winscp-net-assembly-how-to-upload-files-to-home
None of those RemotePath Values does work :(

The Error is:
WinSCP.SessionRemoteException: Cannot create remote file '/test.xml'.
Permission denied.
Error code: 3
Error message from server: Permission denied



I don't know how to remove the leading '/'.

Reply with quote

Advertisement

vandyke
Guest

Re: Upload File to the root directory doesn't work

ok, after do some more investigation I found out, that I can't upload a file to the root duo permission restrictions on the server. I was just confused, because I was able to create a new file with filezilla in the root directory. I inform the server administrator.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,442
Location:
Prague, Czechia

Re: Upload File to the root directory doesn't work

vandyke wrote:

ok, after do some more investigation I found out, that I can't upload a file to the root duo permission restrictions on the server. I was just confused, because I was able to create a new file with filezilla in the root directory. I inform the server administrator.
If you can create file in the root with FileZilla, you must be able to create it with WinSCP (other things equal).

Show us a complete verbose session files for both FileZilla and WinSCP.

Reply with quote

vandyke
Guest

Re: Upload File to the root directory doesn't work

Sorry, the administrator changed something. Now I am not able to create a file in the root directory anymore.
So, all is working fine now.

But I want to thank you for your ecellent program and the dotnet library :wink:

Reply with quote

Advertisement

You can post new topics in this forum