Differences

This shows you the differences between the selected revisions of the page.

script_locking_files_while_uploading 2017-11-13 script_locking_files_while_uploading 2022-06-16 (current)
Line 8: Line 8:
  - Upload data files to temporary ("upload") folder and move them atomically to target folder once the upload finishes.   - Upload data files to temporary ("upload") folder and move them atomically to target folder once the upload finishes.
  - Upload data files to distinct temporary name, e.g. with ''.filepart'' extension, and rename them atomically once the upload finishes. Have the automated system ignore the ''.filepart'' files.   - Upload data files to distinct temporary name, e.g. with ''.filepart'' extension, and rename them atomically once the upload finishes. Have the automated system ignore the ''.filepart'' files.
 +- A gross hack is to periodically check for file attributes (size and time) and consider the upload finished, if the attributes has not changed for some time interval.
Here we focus on the third approach (although the second is very similar, implementation-wise). Here we focus on the third approach (although the second is very similar, implementation-wise).
-===== Using Transfer to temporary filename feature =====+===== [[temporary_filename]] Using Transfer to temporary filename feature =====
With [[sftp|SFTP protocol]], you can use [[resume#automatic|Transfer to temporary filename]] feature to have WinSCP handle the rename automatically for you. With [[sftp|SFTP protocol]], you can use [[resume#automatic|Transfer to temporary filename]] feature to have WinSCP handle the rename automatically for you.
Line 52: Line 53:
        UserName = "user"         UserName = "user"
        Password = "mypassword"         Password = "mypassword"
-        SshHostKeyFingerprint = "ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"+        SshHostKeyFingerprint = "ssh-rsa 2048 xxxxxxxxxxx..."
    }     }

Last modified: by martin