Access denied when put files from fileshare

Advertisement

bejo
Joined:
Posts:
1
Location:
Sweden

Access denied when put files from fileshare

Hi,

I am using the WinScp lib and trying to transfer a file from a fileshare to a SFTP server:

session.PutFiles(@"\\myserver.com\share\myfile.txt", "/uploads/folder/myfile.txt", false, transferOptions);

When using a fileshare \\myserver.com\share I get the following:

WinSCP.SessionRemoteException: File or folder '\\myserver.com\share\myfile.txt' does not exist.
System Error. Code: 5.
Access is denied
at WinSCP.OperationResultBase.Check()
at FileShareAccessTest.Program.Main(String[] args)

I have checked the user permissions for the fileshare and folder and it is full rights.
I can list files and folders on that file share with Directory.GetFiles().
It also works with another fileshares.

Could it be an firewall issue on the fileshare server \\myserver.com?
Do I need to open specific ports on the fileshare server for "session.PutFiles"?

Or what can I do to get more information?

Best regards,

/Jörgen

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: Access denied when put files from fileshare

So if you create a plain WinSCP script with get \\myserver.com\share\myfile.txt /uploads/folder/myfile.txt, would it fail the same way?

And if you call the script from a batch file, with copy \\myserver.com\share\myfile.txt before running WinSCP, would copy work or not?

Reply with quote

Advertisement

You can post new topics in this forum