Configure Delete File interface

The purpose of this user interface is to add application logic that deletes files related to a database record.

To delete a file, you must first have a page that uploads files to the server when inserting fields into the database. To learn how to add such functionality, see the Upload Files section.

Access the trigger from the Application panel, Server Behaviors -> + -> MX Kollection -> File Upload -> Delete File. The user interface that opens is divided into two tabs. Configure them as shown below.


 
To set the dialog box options for the first tab, follow the next steps:
  1. In the Table column drop-down menu select the table field that contains reference to the files on disk.
  2. The Renaming rule text box enables when in the Table column drop-down menu you selected None: Rename rule. You can use the InterAKT Dynamic Data to compose the rule.
  3. In the File folder file field, select the folder on the server where files are stored. You can use the Browse button to select it from one of the site's folders or you can use the InterAKT Dynamic Data to insert dynamic placeholders into the text box (which will be replaced with their values at runtime).
  4. The three buttons in the top right corner of the interface offer you the next functionality:
    · Click OK when you are done configuring the trigger.
    · Click Cancel to exit without applying the new settings.
    · The Help button opens this help page.
    These buttons are common to both tabs of the Delete File interface.

  5. Click on the Advanced tab to continue with configuring the trigger.
 

 

For instructions on completing this step, see the Advanced tab. For the Delete File trigger, by default the Priority is set to 98 (since the trigger works with files, it should execute among the last) and the Type is AFTER, as it should execute after the transaction was completed.

The server behavior added this way can be edited later by double-clicking its name in the Server Behaviors tab of the Application panel.

 

If the file to delete is actually an image, the program tries to locate any existing thumbnails, and if any are found, it also deletes them.