tracker issue : CF-3983155

select a category, or use search below
(searches all categories and all time range)

Cfexchagemail getAttachments does not work correctly with "/" in the attached filename

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Stefan Fritzsche / Stefan Fritzsche (Stefan Fritzsche)

Created: 05/07/2015

Components: CFExchange

Versions: 10.0

Failure Type: Unspecified

Found In Build/Fixed In Build: Final /

Priority/Frequency: Normal / Very few users will encounter

Locale/System: English / Win 2008 Server R2

Vote Count: 1

Listed in the version 2016.0.0.297996 Issues Fixed doc
Verification notes: verified_probably_fixed on February 16, 2016 using build 2016.0.01.298513
If you try to get attachments with cfexchangemail and the filename contains a "/", Coldfusion will throw an error. It interprets the filename as a directory which you can see in the error detail:

ERROR:$ExchangeAttachmentIOException: Error reading or writing attachment. 
ERROR TYPE:     Application 
ERROR MESSAGE:  Error reading or writing attachment. 
ERROR DETAIL:   Attachment path = C:\ColdFusion10\tmp\XXXXXXX\X.PDF. 

If you don't try to save the file and just request the attachment info, there will be no error. You are able to dump the response and it keeps the filename with "/". 

<!--- build connection --->
<cfexchangeconnection action="open"

<!--- not working with files like "XXXXXXX/X.PDF? " --->
<cfexchangemail action="getAttachments"
      connection = "myCon"
      generateUniqueFilenames="true" />
<!--- works fine --->
<cfexchangemail action="getAttachments"
      connection = "myCon"
      uid="mailUid" />

<!--- close connection --->
<cfexchangeConnection action="close"

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3983155

External Customer Info:
External Company:  
External Customer Name: Stefan
External Customer Email:  
External Test Config: Windows 2008 R2, Exchange 2010 SP3


  1. May 11, 2015 00:00:00: 2_hf1000-3983155.jar


Hi Stefan, We are looking for some more clarification on this bug. You have file named XXXXXXX\X.PDF with an attachment with an user's mail. While trying to get the that attachment with file named XXXXXXX\X.PDF you ran into issue. Is it correct? you can't save a file with name that contains '\' or '/'in it. The reason is Windows or Unix file system itself prevents you from doing that. Not sure how you have a file named like that is there as an attachment. But assuming somehow you have such an attachment, I have added the fix to download it as a file name stripping those characters that are not not allowed by OS. Place the jar hf1000-CF-3983155.jar under C:\ColdFusion10\cfusion\lib\udates directory and restart the server and try
Comment by Krishna R.
7626 | May 11, 2015 03:45:48 AM GMT
The fix is added as an attachment. Please check and let us know.
Comment by Krishna R.
7627 | May 11, 2015 04:07:41 AM GMT
Hey, thank you for your reply. I forwarded the fix to our admin. We will let you know if it will work. The files are generated with SAP from our partner. We try to figure out how they can generate these files.
Comment by External U.
7628 | May 11, 2015 04:53:04 AM GMT
The fix works. Ty for your help.
Comment by External U.
7629 | May 11, 2015 08:20:56 AM GMT
I am seeing this same issue with a colon ":" in the attachment file name. I'm running CF 2016. Can you strip out colons, please?
Vote by Alex F.
30610 | April 05, 2019 02:46:48 PM GMT
I am seeing this same issue with a colon ":" in the attachment file name. I'm running CF 2016. Can you strip out colons, please?
Comment by Alex F.
30609 | April 05, 2019 02:47:16 PM GMT