07 Jun 2017 11:48:27 Bruce Wilkie posted:
I've watched the video on how to delete when updating, but that relies on using the File upload to identify the 'path' of the file to delete. (www.dmxzone.com/go/32398/dmxzone-file-system-connector-manual/32399/deleting-files-when-updating-database-records
I'm just using a form to delete the record and then want to delete a file as well (and then a thumbnail of the file since it's an image in this case).
How do I identify the file/path to delete? I've added in a query that selects the file name from the database table using the file id as I thought I could then use this. But when I then add the next step, 'If File Exists' and click on the Dynamic lightning symbol for path, there's nothing in the 'DMXzone Server Connect - Data Bindings Pickup' window to select the file. Under 'Execute > Steps' there is the Database Query that I created, but I can't expand that any further to select the filename or path.
Similarly, if I miss out the 'If File Exists' step and try to just insert a 'File Remove' step I can only see the database query and can't drill down any further to get to the filename or path.
I'm adding the file deletion to an already working record deletion Server Action. Current steps are:
Delete Record (using hidden form field that holds the record id)
If I'm thinking right then adding file deletion to this, the steps should now be:
Database Query (to select the filename)
If File Exists (using filename selected)
Delete File (using filename selected)
Please can you let me know what I'm doing wrong?
I'm thinking I could create a second hidden field within the form that contains the filename and use that instead of a database query. Is that the only way or should I be using the database query the way I'm trying to do here?