Duplicate file uploads when using Regex File Upload trigger actions
Posted by John Villanueva on 31 May 2018 08:11 PM

When you see the same file getting uploaded or downloaded multiple times (2 or more times) by a particular trigger, the first thing you will want to check is whether the trigger is using a "... Regex File Upload" type of trigger action. For example:

  • AFTP Regex File Upload
  • FTP Regex File Upload
  • SFTP Regex File Upload
  • Trading Partner Regex File Upload
  • etc

These types of trigger actions are designed to search for files matching a regular expression. If multiple matches are found, then all those matching files will be uploaded. Sometimes, that is really the intention. However, oftentimes it is not. Let me give you a particular example.

Let's say, a server admin wants all files that are added to a particular directory to be automatically uploaded to a trading partner. The admin then proceeds to create a trigger that:

  1. Responds to the 'directory monitor file added' event type 
  2. Uses the Trading Partner Regex File Upload trigger action
  3. Uses the *.* wildcard 

To avoid duplicates, the admin also enables the 'Delete on Success' setting in the trigger action parameter's dialog. Unfortunately, this won't do. Let me give you a sample scenario.

Let's say file01.edi is added into the monitored directory. MFT Server then searches for files with the 'edi' extension in the monitored directory and then, finding file01.edi, uploads that file. A split second later, file02.edi is also added to the same directory. Like in the previous scenario, MFT once again searches for files with the edi extension in the monitored directory. If file01.edi was somehow not (yet) deleted, MFT Server would upload both file01.edi and file02.edi and whichever other *.edi file it finds there.

If your intention is to automatically upload files that arrive at a particular directory (whether through a 'File Upload', 'Directory Monitor File Added', or similar event type), a better solution would be to simply use a "... File Upload" or "... File Download" trigger action (without the Regex). 

Just make sure that, when you specify the file to be uploaded in the trigger action parameters dialog, you enter either %File% or %LocalPath% variable (whichever is available for a given trigger). So, each time a file arrives at the directory in question, MFT Server will take that file's path from %File% or %LocalPath% and use that in specifying which file to upload. This will prevent duplicate file uploads. 

(1 vote(s))
This article was helpful
This article was not helpful

Comments (0)
Post a new comment
Full Name:
CAPTCHA Verification 
Please enter the text you see in the image into the textbox below. This is required to prevent automated registrations and form submissions.

Help Desk Software by Kayako