Avatar of craigbtg
craigbtg

asked on 

Cfmailparam Attachment Filename With Plus Sign

Hello,

I am using Cfmailparam to add a file attachment and it is giving me an HTTP 500 Internal Server Error.

I have narrowed the problem down to the filename of the attachment.  My filename is C:\fileA+B.pdf and more specifically my cfmailparam code is as follows:

<cfmailparam file="C:\fileA+B.pdf" disposition="attachment">

The plus sign causes the error.  Can someone please tell me how I can evaluate the filename so cfmailparam will allow it to attach?  Thanks.
ColdFusion Language

Avatar of undefined
Last Comment
James Rodgers
Avatar of James Rodgers
James Rodgers
Flag of Canada image

have you tried encoding the name?

eg:

and then


untested, just thinking out loud, you might just want to do it on the name and not the extension that way the  . (period/dot) doesn't get encoded, in the above is did not include C:\ in the urlencoding
Avatar of craigbtg
craigbtg

ASKER

Yes, tried that and it did not work.  Also tried surrounding the full path with quotes.  

It doesn't look like cfmailparam allows filenames with "non-standard" characters.  Thing is though that saving with cffile works fine with the same name.  I could see if it was consistent across all tags, but it only seems to be related to cfmailparam.

Any other suggestions?  Thanks.
Avatar of James Rodgers
James Rodgers
Flag of Canada image

what version of CF are you using?
Avatar of craigbtg
craigbtg

ASKER

The version is MX7.
Avatar of James Rodgers
James Rodgers
Flag of Canada image

i cant find anything that says it shouldn't work, or that special char are not allowed, do you get the problem with other non-alphanumerics (!) for example?
 
Avatar of craigbtg
craigbtg

ASKER

No, it does not work with other non-alphanumeric characters either.  I tried apostrophe (!) and it did not allow it.
Avatar of craigbtg
craigbtg

ASKER

Does anyone have an answer for this?  Is it a bug with cfmailparam or is there a way to escape the special characters?  Cffile works fine with non-alphanumeric characters.  Thanks.
ASKER CERTIFIED SOLUTION
Avatar of craigbtg
craigbtg

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
not really what your looking for but might be helpful

http://www.snugserver.com/kbase/question.php?qstId=171

email standards
http://www.rfc.net/rfc2822.html
http://rfc.net/rfc2046.html
http://www.rfc.net/rfc2045.html

but again i haven't found anything that explicitly forbids it
ColdFusion Language
ColdFusion Language

ColdFusion is a server-side rapid application development platform originally created by Allaire and now sold by Adobe, implementing the dynamic general purpose CFML programming language. The term ColdFusion is sometimes colloquially used to refer to the CFML language (Cold Fusion Markup Language), but can also include discussions of the server software implementation. ColdFusion runs using a customised version of Apache Tomcat. Earlier versions are bundled with JRun.

11K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo