Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

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?
bejo

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