• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: How to delete uploaded file from server after mail

How to delete uploaded file from server after mail 12 years 9 months ago #14152

  • SLV11
  • SLV11's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
I design the form with the field "file" for uploading file and subsequent sending it to the subscriber or manager by email. This file is uploaded on a server into a folder ../components/com_rsform/uploads.
How properly delete these fil from server (from a folder ../components/com_rsform/uploads) after sending it attached to the email.
There is no such option in adjustments of the form (or I has not found it).

I have tried to put such script
$var ='{file1:value}'; 
unlink($var);
into scripts tab ($thankYouMessage - after processing the form), but file was not deleted. Email is sending correctly,

I tried to place there only the text for example
echo'Hello World';
but even this text did not shown in the "thankYouMessage" window.

Joomla 1.5.23
RSform! 1.3.0 rev 36
Last Edit: 12 years 9 months ago by SLV11.
The administrator has disabled public write access.

How to delete uploaded file from server after mail 10 years 7 months ago #24729

I know this is an old post, but I came across it while I was looking for the same thing. I solved it myself and want to post here in case someone else is looking for the same solution.

On my webhost (cPanel) I added a cronjob with the following command:

/home/USERNAME/public_html/components/com_rsform/uploads -type f -mmin +5 ! -name index.html -exec rm {} \;

This will delete any files that are older than 5 minutes (a safety buffer to make sure that RSForms! has finished processing it before it gets deleted) in the uploads folder except the system index.html file.

I hope this helps someone.
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!