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?