Sometimes, for security reasons or simply just to save disk space, we want certain files to be automatically deleted from the server as soon as its intended recipient has already downloaded it. Today, you'll learn how to do that on JSCAPE MFT Server.
This particular auto-deletion process entails creating a trigger that:
Let's walk you through those steps now.
First, let's create a new trigger. To do that, go to the Triggers module and then click the Add button.
Next, give this trigger a name, e.g. "Delete Downloaded File".
After that, select the "File Download" Event type from the drop-down list.
Click Next when you're done.
For this example, we want the trigger to affect any downloaded file, so just enter this expression into the Trigger Conditions box.
Success = TRUE
This tells the trigger to proceed only if the download was successful.
In some cases, however, you might want to restrict the automatic file deletion process to certain downloads. For example, you might want it to apply only to: certain files, or to files downloaded by a certain user, or only during certain times, etc.
In such cases, you can specify your conditions by entering logical expressions into the Trigger Conditions box. You can view the properties pertinent to this particular trigger event whose values you can use for filtering by clicking on the Variables button.
Here are a few examples of trigger conditions you can use:
✔ To restrict the auto deletion to jpg files:
LocalPath ~ ".*\.jpg"
✔ To restrict the auto deletion to files downloaded by a user whose username is "johnsmith":
Username = "johnsmith"
✔ To restrict the auto deletion to files downloaded during Mondays:
DayOfWeek = 1
You can even use a combination of these conditions to filter the trigger even further.
Click Next as soon as you're ready to proceed.
Click the Add button.
The trigger action we'll be needing for this particular scenario is the one named "Delete File". Select that from the drop-down list and then click OK.
Because we want this to apply to the file that's been recently downloaded, enter the variable %LocalPath% into the box labeled File. The %LocalPath% variable holds the complete path (directory and filename) of the file that was recently downloaded.
Click OK when you're done.
Once you're back at the main screen, don't forget to click the Apply button to finalize your trigger creation process. Otherwise, this trigger won't execute.
And you're done! Every time a user downloads a file from your server, that file will be automatically deleted.
Would you like to try this yourself?
Get a free trial of JSCAPE MFT Server.
How To Automatically Decrypt PGP-Encrypted Files Upon Upload