Nathan,

>Is there any way to safely delete files that were attached using a
><cfmailparam> tag to an email that was generated with the <cfmail> tag?  If
>you delete the attached file too soon, then the file doesn't get attached
>to the email, at best, and at worst, the email fails altogether.
>
><cfmail to="[EMAIL PROTECTED]" to="[EMAIL PROTECTED]" subject="See Attachment">
>  <cfmailparam file="#theFullFilePath#">
>  See attached file, #GetFileFromPath(theFullFilePath)#
></cfmail>
><cffile action="delete" file="#theFullFilePath#">
>
>I know for a fact that this worked just fine in CF 5, because the contents
>of the attached file would be included as a base64 string in the .mail file
>that was written to the spool.  In the MX versions of CF, only path of the
>attached file is put in the .mail file, meaning the attached file had to
>stick around until the .mail file in the spool could be processed.
>
>It seems like a significant feature digression, but I have found zero
>documentation on this from Adobe.  It is quite a hindrance if you are
>attaching (gasp) dynamically generated files to emails to create an entire
>separate process to manually clean up the files from the file system.

Adobe did this to speed up mass e-mailings that all use a common set of
attachments--which is common when doing bulk mailings. Obviously in this
case there's considerably less disk space used and does speed things up.
However, when you're trying to send dynamically generated content it's a
real PITA.

Here's a blog entry I wrote a while back which shows how the JavaMail API
can be used directly to send SMTP without needing to write attachments to
disk:
http://blog.pengoworks.com/blogger/index.cfm?action=blog:584

There's also this blog entry over at Charlie Arehart's site which discusses
some alternatives (see the comments):
http://carehart.org/blog/client/index.cfm/2007/1/13/cfdocument_name_attribut
e

-Dan


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Enterprise web applications, build robust, secure 
scalable apps today - Try it now ColdFusion Today
ColdFusion 8 beta - Build next generation apps

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:292093
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to