Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
7.8k views
in CompleteFTP by (51.1k points)

We're often asked questions like the following:

When a user uploads a file, it maintains a .filepart extension, even though the transfer has successfully completed.  It appears to occur when a WinSCP client is used to upload a file.  WinSCP tacks on the .filepart extension until the upload is complete and then it renames the file.   The problem with this is, we have an event handler that moves newly uploaded files to a separate server for processing once the upload is complete.

 

1 Answer

0 votes
by (51.1k points)
edited by
 
Best answer

WinSCP, and other clients, do this because they want to ensure that it's possible to distinguish between truncated uploads and completed uploads.  In your case, it fails because the file is moved immediately after it's been uploaded and before the command to rename it is executed.  The file, with the .filepart, extension will be moved by the process trigger event-handler and the rename command will therefore fail.

One way to avoid this is to use a regular expression file filter to ensure that the event-handler does not get triggered for files whose names have the .filepart extension.  You can do this using the following filter:

regex:^/Home/.*((?!filepart).)*$

This causes the event to trigger for any file underneath /Home whose name doesn't end with 'filepart'.  You may of course need to change the path from /Home to something else.  The 'regex:' at the front simply lets CompleteFTP know that the rest of the text is a .NET regex.  You also need to enable the event for the 'Move file' event since the final operation isn't an upload but a rename.

Categories

...