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.

Automation

When using scripting, add -nopreservetime and -nopermissions switches to put command. With synchronize command, this works only when -criteria is none or size and it never works in both mode.

Advertisements:

When using .NET assembly, set TransferOptions as shown in following examples:

C# example:

TransferOptions transferOptions = new TransferOptions();
...
transferOptions.FilePermissions = null; // This is default
transferOptions.PreserveTimestamp = false;

PowerShell example:

$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.None or SynchronizationCriteria.Size and it never works when mode parameter is SynchronizationMode.Both (learn enumeration syntax in PowerShell).

 
  messages.txt · Last modified: by prikryl
 

Search Documentation

This page

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

Associations

Site design by Black Gate