August 30, 2008
For ColdFusion hosting try HostMySite.com. |
Home /
Groups /
Adobe Flex 2
Preventing strange chars in XML
I am resending this because I think it never made it to the list.Stefan Richter 05/14/08 09:27 A Generally I recomended the function xmlFormat() which escapes charactersIan Skinner 05/14/08 09:32 A Ah cool, just what I was looking for.Stefan Richter 05/14/08 09:59 A 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 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'. 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 -----
|
Mailing Lists
|
Latest Fusion Authority Articles
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||