House of Fusion
Home of the ColdFusion Community
Hostmysite Dedicated Hosting

Search flex

August 30, 2008

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
           1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31             

Subscribe Now
Fusion Authority Quarterly Update - ColdFusion 8 Special Edition

For ColdFusion hosting try HostMySite.com.
Search over 2,500 ColdFusion resources here  >>>      
Home /  Groups /  Adobe Flex 2

Preventing strange chars in XML

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Stefan Richter
05/14/2008 09:27 AM

I am resending this because I think it never made it to the list.   Apologies for any double post. Hi all, I have a file uploader for images in Flex. It submits to a CF script   which in turn returns an XML tree containing a list of all uploaded   files. Yesterday the system stopped working and I tracked it down to a single   image which had some strange characters in its filename (they looked   foreign, or at least not familiar). The filename of the uploaded image   broke my application. I'm sure this is an easy one: is there a CF function or similar I can   apply to the image name that would convert any non-conforming   characters t something that does not cause problems later on,   especially once the filename is included inside an XML structure? Right now this is how I write the XML:             <cfxml variable="userXML">                 <cfoutput>                 <brainwave action="#FORM.action#" status="success">                           <cfloop query="fetchassets">                 <asset id="#id#" type="#assettype#" width="#width#"   height="#height#">                     <path>#path#</path>                 </asset>                 </cfloop>                 </brainwave>                 </cfoutput>             </cfxml> And here's my upload: <cffile action="upload" filefield="Filedata" destination="#clientdir#"   nameconflict="makeunique" /> Be gentle, I am from the Flash/Flex side of the fence so CF is not my   mother-tongue. Cheers Stefan

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Ian Skinner
05/14/2008 09:32 AM

Generally I recomended the function xmlFormat() which escapes characters for just this purpose.  But I am not sure escaped characters would make good file names, but my brain is too foggy this morning to know for sure. Secondly you might wrap the file section of your XML tree in a CDATA block that tells the XML 'there be unsafe characters here, ignore them'.

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Stefan Richter
05/14/2008 09:59 AM

Ah cool, just what I was looking for. thanks! Stefan On 14 May 2008, at 14:31, Ian Skinner wrote: ----- Excess quoted text cut - see Original Post for more -----


<< Previous Thread Today's Threads Next Thread >>

Mailing Lists