Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

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)


Topic review


That worked, thank you!

Error occurred while setting the permissions and/or timestamp

I've been running a powershell script daily for about a year against an external FTP server and it has worked fine. Suddenly it stopped working. The script uploads one file and stops on this error:

Upload of file 'file.xml' was successful, but error occurred while setting the permissions and/or timestamp.

If the problem persists, turn off setting permissions or preserving timestamp. Alternatively you can turn on 'Ignore permission errors' option.
No such file or directory.
Error code: 2
Error message from server (en-US): No such file

I've searched around and people say to turn on ignore permission errors. However I can't seem to find exactly how to do that since I'm doing the .net assembly way of doing this script. I found transfer options and input them like so:
$transferOptions = New-Object WinSCP.TransferOptions
$transferOptions.FilePermissions = $Null
$transferOptions.PreserveTimestamp = $False
$session.PutFiles($item, $remotePath, $transferOptions).Check()

But it seems to have no effect. I'm not sure if I'm doing the transfer options correctly, and I'm not sure if I'm even using the correct transfer option. Can anyone help?