Forums

How can I delete the file that was uploaded after sending the email?

ijumo 03 Jul, 2018
Hi,

how can I delete the file that was uploaded after sending the email? I saw in the FAQ that there is a way to delete old files via PHP (https://www.chronoengine.com/faqs/53-chronoforms/cfv4/cfv4-file-uploads/2665-how-can-i-delete-old-file-uploads) but I need a solution that deletes the file immediately after sending the email and it should only delete the file that was uploaded, not all other files in the upload folder.

I searched the forum but couldn't find a solution that works with ChronoForms v6.

JM
GreyHead 04 Jul, 2018
Hi JM,

You can use a PHP action after the Email action to delete the file.

Bob
ijumo 04 Jul, 2018
Hi Bob,

how do I get the file name? Of course I know the folder where the file is stored but the file name changes constantly.

JM
GreyHead 05 Jul, 2018
Hi JM,

It will be in the form data at that point, you can add a Debugger action temporarily to see - also check the shortcode variables FAQ.

Bob
This topic is locked and no more replies can be posted.