I've had this same issue before. I believe the file was being deleted before the mail was fully processed. I think the solution I came up with was to place the file in a temporary directory then run a batch program to delete the files from that directory in the nightly run.
Robert Harrison Director of Interactive Services Austin & Williams Advertising I Branding I Digital I Direct 125 Kennedy Drive, Suite 100 I Hauppauge, NY 11788 T 631.231.6600 X 119 F 631.434.7022 http://www.austin-williams.com Blog: http://www.austin-williams.com/blog Twitter: http://www.twitter.com/austin_williams -----Original Message----- From: Steve LaBadie [mailto:[email protected]] Sent: Wednesday, October 23, 2013 9:08 AM To: cf-talk Subject: CFFILE Question I have a web-based form that requires the user to upload a document. Everything works fine until I try and delete the document after delivery. With the delete action enabled the email does not get delivered. I have place the action=delete inside and outside of the </cfmail> <cfif isDefined("form.attached") AND form.attached NEQ ""> <cffile action="upload" destination="f:\inetpub\wwwroot\......\......\upload" mode="644" nameConflict="overwrite" fileField="form.attached"> <cfset attachment="f:\inetpub\wwwroot\......\......\upload\#cffile.serverFile#"> </cfif> <cfprocessingdirective suppresswhitespace="no"> <cfmail from="#......#" to="#......#" subject="" type="html"> <cfsilent><cfif FORM.attached neq ""><cfmailparam file="#attachment#" /></cfif></cfsilent> </cfmail> <cfif isDefined("form.attached") AND form.attached NEQ ""> <cffile action="Delete" file="#attachment#"> </cfif> Steve LaBadie, Web Manager East Stroudsburg University 570-422-3999 [email protected]<mailto:[email protected]> [facebook-16x16]<http://www.facebook.com/eaststroudsburguniversity> [twitter-16x16] <http://twitter.com/esuniversity> [youtube-16x16] <http://www.youtube.com/user/esuedu> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:356964 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

