Upload of file .. 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.
You get this error, when a server fails to update file timestamp or permissions for some reason:
- On some systems, you need to be an owner of the file (write permissions are not enough) to modify its permissions or timestamp.
- Some servers do not support updating file timestamp or permissions at all.
- Some servers are set up to pickup any uploaded file immediately, process it somehow and delete or move it away. If the server is quick enough, it does that before WinSCP is able to update the file timestamp or permissions.
Whatever the reason is, you need to turn off Set permissions and Preserve timestamp options or turn on Ignore permission errors.
Note that you cannot disable preserving timestamp for synchronization, unless you turn off Modification timestamp comparison criteria.
When using scripting, add
-nopermissions switches to
put command. With
synchronize command, this works only when
size and it never works in
When using .NET assembly, set
TransferOptions as shown in following examples:
TransferOptions transferOptions = new TransferOptions();
transferOptions.FilePermissions = null; // This is default
transferOptions.PreserveTimestamp = false;
$transferOptions = New-Object WinSCP.TransferOptions
$transferOptions.FilePermissions = $Null # This is default
$transferOptions.PreserveTimestamp = $False
With Session.SynchronizeDirectories, this works only when
criteria parameter is
SynchronizationCriteria.Size and it never works when
mode parameter is
SynchronizationMode.Both (learn enumeration syntax in PowerShell).