Forums

Auto deletion of attachment

arvee 30 May, 2015
Hello,

I am new to ChronoForms. I manage to study it well within 3 days from creation of simple to complex forms. After successfully created a form with attachment and make it work 100%, I am concern about the files stored in my webserver's chronoforms' folder. Whereas I've checked recently that anything that is attached to the form, it will reside on the chronoform's folder since I didn't use any new folder to store those attachments. However, I don't want to access the backend everyday to delete any file on this specific folder. Is there any way that the attachment can be deleted automatically once the submission of the form is completed and successful? Where and how will I do that?

Thank you very much.
GreyHead 30 May, 2015
1 Likes
Hi arvee,

How do you know that submission is completed and successful?

You can delete a file after the email is sent but that could be a problem if an email goes astray?

Probably better to set up a separate form action with some custom PHP to check the folder and delete any files more than say 30 days old. You can set this up to run as a scheduled cron job from your server.

Please see this FAQ - it looks as though the code may need updating a little for Joomla! 3

Bob
arvee 31 May, 2015
Hi Bob,

Thank you for your reply. Whenever I am testing the forms that I created, the e-mail account linked with the ChronoForms and joomla is always open and also the chronoforms folder on my webserver so that I get an output immediately. I will try your code sir.

Thank you very much.


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