| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| 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> |
|
#2
| |||
| |||
| 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. |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.