FTP clients, particularly WinSCP, often follow a process where they upload a temporary file with a ".filepart" extension. This temporary file is later renamed to the target name upon successful completion of the transfer.
The challenge arises when Cerberus receives a file upload notification complete event, triggering a rule, while simultaneously, the client is renaming the file to its correct name. This can lead to issues where the file name still exists, but the client has the file open for renaming, resulting in a "file is in-use" message. Alternatively, the event may occur right after the client renames the file, causing an error indicating that the file doesn't exist.
To address this situation effectively, it is recommended to enhance your File Transfer Event rule by adding a condition that excludes files containing the string ".filepart". This can be achieved by specifying a condition that checks whether the file does not contain the substring ".filepart."
From there you can handle the rename with a File Move/Copy event where the FROM filename ends with ".filepart". In that case, you know it's the rename after an upload and you can move the file as part of the action for that event.
Disabling '.filepart' Setting in WinSCP to Prevent Transfer Issues
To avoid encountering the ".filepart" issue in WinSCP, you can disable the filepart setting. Follow these steps:
- Open WinSCP and navigate to 'Options.'
- In the 'Preferences' menu, go to 'Transfer.'
- Click on 'Endurance.'
- Under 'Enable transfer resume/transfer to temporary filename for,' select 'Disable.'
- Click 'OK' to save the changes.
By disabling this setting, WinSCP will no longer use temporary ".filepart" files during transfers.
You can learn more about configuring the Event Manager here.