This rule will automatically delete a file located in the /uploads/temp folder after it has been downloaded by a user named batch_process.
Adding the New Rule
- Go to the Event Rules page of the Event Manager
- Click the New button. The Add A New Event Rule dialog will appear.
- Select the File Transfer Event Rule Type for your new rule. This event type will cause the rule to be triggered whenever a file transfer takes place.
- Enter a name for your rule in the Rule Name edit box. For example, “Delete on Download”.
- Press the Add New Rule button on the Add A New Rule dialog to save and add the new Event Rule. The event rule will be selected and ready for editing on the Edit Rules page.
Select a Rule Matching Mode
Select the Match If All Filters Match mode. Selecting this option means that this rule will only be triggered whenever the rule’s event occurs and if all of the conditions listed are fulfilled.
Adding the Rule Conditions
A rule’s actions are carried out whenever that rule’s event trigger happens. In this example, a File Transfer Event triggers our rule. To further limit this rule to only triggering when a file is uploaded to a specific folder, and by a specific user, we need to add three conditions or filters to the rule.
- There needs to be a filter that ensures this is a download and not an upload. To limit this rule to only triggering on an upload, select the {{D}}, Is a Download, variable from the conditions drop-down list. Select Equals as the comparison, and set the value to true.
- We also need a filter to ensure the rule only triggers when the user batch_process uploads a file. Select the {{U}}, Username, variable from the conditions drop-down list. Select Equals as the comparison, and set the value to batch_process.
- Finally, we only want this rule to trigger whenever the file is uploaded from the /uploads/temp folder. Select the {{RFP}}, Remote File Path, variable from the conditions drop-down list. Select Starts With as the comparison, and set the value to /uploads/temp.
Adding the Rule Actions
When an event matches all of the conditions of a rule then the rule actions are carried out. In this case, we want to delete the downloaded file from the server when the user batch_process downloads a file from a specific folder.
- Add a Launch a File Operation action
- Select Delete File as the operation sub-action
- Enter the variable {{LFP}} to delete the local file on the server
Comments
0 comments
Please sign in to leave a comment.