Error occurred while setting the permissions and/or timestamp

Advertisement

warbick
Joined:
Posts:
2

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?

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum