PHP - DOMDocument load XML with encoded name

Neebyrest

New Member
Lets say that in my flash project I have script that create for me xml files dynamically (by PHP). XML file name is based on specific variable and escaped using \[code\]escape(variable)\[/code\] in case that variable may (and mostly do) contains unsupported filename chars...I need to know precise name of xml file later in my flash project, because I'm loading these XML files only if \[code\]unescape(XMLfile) == variable\[/code\] . There's a lot of variables, so I can't just use \[code\]String.replace()\[/code\] function to wipe out unsuported fileneme chars...There's part of PHP file I'm using:\[code\]$XMLDom = new DomDocument('1.0', 'UTF-8');$xmlId = trim($_POST['xmlId']);if(file_exists($xmlId)){ $XMLDom ->load($xmlId);}else{ $newXMLHandler = fopen($xmlId, 'w') or die("can't open file"); fclose($newXMLHandler); $XMLDom ->load($xmlId); .... rest of the code .... $XMLDom ->save($xmlId);}\[/code\]The result of the code above is that in directory are 2 newly created XML filesOne XML empty created by \[code\]fopen($xmlId, 'w')\[/code\], named: "fi%20le%2C%2E%40.xml"and second one named: "fi le,[email protected]" where all my new XML data is stored...Is there any way to load escaped named XML file by PHP?Thanks in advance.Arthur.
 
Back
Top