I have a form right now on our website where someone can attach a file on a form for recruiting purposes. The file is uploaded then an email is sent to human resources with the attachment.
Right now the file just sits in the server afterwards and needs to be deleted manually every once in a while.
How would I add to the code below to simply delete the file after the email was successfully sent?
<!--- Upload --->
<cfif #FORM.FILE# IS NOT "">
<cffile action="upload" FileField="File" destination="#expandPath('./')#upload/" NameConflict="Makeunique">
<!--- email --->
<cfmail to="email@example.com" from="firstname.lastname@example.org" subject="My Subject" type="HTML">
<!--- attach a file if specified --->
<CFIF #FORM.FILE# IS NOT "">