CFMAILPARAM - Attachment Lossing Names

This is a discussion on CFMAILPARAM - Attachment Lossing Names within the Cold Fusion forums in Application Servers & Tools category; Hi all, Currently, I'm using CF7. When I attached a PDF inside a CFMAIL, the filename within the email became "ATT411668.dat", instead of "FileName.PDF". 1) I've removed all the non-alphanumeric characters. 2) I've truncated the filename to only 49 characters. Assume #docname#.PDF exists. Do you know why? Please advise. Thanks. Best regards, Raymond Cheung <cfscript> docname = "This Time, It's Different!"; docname = REreplace(docname,"[^a-zA-Z0-9]","","all"); docname = replace(docname,"&","","all"); docname = replace(docname,",","","all"); docname = replace(docname,"!","","all"); docname = replace(docname,"?","","all"); </cfscript> <cfif (len(docname) gt 50)> <cfset docname = left(docname, 49)> </cfif> <cfmail to="to @ adobe.com" from="from @ adobe.com" subject="This Time, It's Different!" type="text"> <cfmailparam ...

Go Back   Application Development Forum > Application Servers & Tools > Cold Fusion

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-25-2008, 02:55 AM
Aumaz Jang
Guest
 
Default CFMAILPARAM - Attachment Lossing Names

Hi all,

Currently, I'm using CF7. When I attached a PDF inside a CFMAIL, the filename
within the email became "ATT411668.dat", instead of "FileName.PDF".

1) I've removed all the non-alphanumeric characters.
2) I've truncated the filename to only 49 characters.

Assume #docname#.PDF exists.

Do you know why? Please advise. Thanks.

Best regards,
Raymond Cheung

<cfscript>
docname = "This Time, It's Different!";
docname = REreplace(docname,"[^a-zA-Z0-9]","","all");

docname = replace(docname,"&","","all");
docname = replace(docname,",","","all");
docname = replace(docname,"!","","all");
docname = replace(docname,"?","","all");
</cfscript>

<cfif (len(docname) gt 50)>
<cfset docname = left(docname, 49)>
</cfif>

<cfmail to="to@adobe.com" from="from@adobe.com" subject="This Time, It's
Different!" type="text">
<cfmailparam file = "c:\temp\#docname#.pdf" type="application/pdf">
This Time, It's Different!
</cfmail>

Reply With Quote
  #2  
Old 08-27-2008, 03:11 PM
SafariTECH
Guest
 
Default Re: CFMAILPARAM - Attachment Lossing Names

This will happen at the recipient's end depending on the mail server/client
they use ... you could send a pdf from your desktop to the same recipient and
it will happen with that too.

It could be a security reflex that it changes the file to a non-binary format
if it is not trusted or seems to be coming from a questionable source.


A number of the government servers seem to do that - no idea why, but renaming
the file at the recipient's end generally allows it to open properly.

Nothing you do in your code is going to change that.

Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 03:51 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.