WinSCP is able to store file being transferred to temporary filename first, renaming it to the target name only once the transfer successfully finishes.
Reasons to do that:
Reasons not to do that:
For performance reasons transfer to temporary file name is enabled by default for files larger than a given threshold. The threshold is initially 100 KiB. You can change the threshold. You can also enable the feature for all files, particularly when looking to achieve the second impact. You may also need to disable the feature altogether, particularly if you do not have permissions required (e.g. permissions to create a new file in target directory). This can be configured on Endurance page of Preferences dialog.
If your transfer is interrupted, a partial file (with
.filepart extension) remains in the target folder. After you try to transfer the file a second time, WinSCP looks for the partial file. If it finds a partial file, it offers you chance to resume the transfer (the confirmation can be disabled).
Note that partial files can be distinguished in file panel by special "torn sheet" overlay icon.
To configure transfer to temporary file name in scripting, use
-resumesupport switch of file transfer commands. In .NET assembly use
TransferOptions.ResumeSupport. This feature is available only in the latest beta release.
There’s an alternative manual method to resume transfer, which can be used with FTP protocol.
If you attempt to transfer a file already in the target directory and the target file is smaller then the source file, the overwrite confirmation dialog displays a Resume button or an Append button (when appending is supported). After you click Append, WinSCP opens another prompt that lets you append source file or resume your transfer.
If you resume the transfer, WinSCP will skip a part of the source file equal to the target file’s size. The program will only transfer the remainder.
Note that you must have overwrite confirmations enabled to use the method.
The method is also useful for resuming transfers initiated by other clients and also to update log files. Manual resuming of text mode transfers with SFTP-4 and newer is not supported.
If you want to resume your transfer, you must use the same source file version as the interrupted transfer. If you do not, your target file will include the source file’s previous version and its current version. For automatic resume, if the partial file is bigger than the source file, WinSCP will display error and disallow resume.
If the target file exists and it is not write-able, but the target directory is, the file will may be transferred anyway with automatic resume. The error overwriting the file will occur only after the transfer finishes. It is because the file is first transferred into temporary file.
Site design by Black Gate