prabirchoudhury
01-10-2010, 05:19 PM
hello all
I am tryng to do convert files details as base64 format and then wrireRaw into the xml file in php 5.1.2 and then covert it back to the original file format, but writeRaw is not supported in this php version. Is any other way to do. I tryed with xml "text" but it is nt working.
function writeb64XML($images, $savePath = 'test.xml', $indentSource = false, $xmlVersion = '1.0') {
$this->xml = new XMLWriter();
$this->xml->openURI($savePath);
if ($indentSource) {
$this->xml->setIndent(true);
}
$this->xml->startDocument($xmlVersion);
$this->xml->startElement('images');
$this->xml->startElement('url');
$this->xml->Text($images["file_name"]);
$this->xml->endElement();
$this->xml->startElement('source');
$this->xml->writeRaw(base64_encode($images["file_data"]));
$this->xml->endElement();
$this->xml->endElement();
$this->xml->endDocument();
return true;
}
i am using php 5.1.2 but "$this->xml->writeRaw(base64_encode($images["file_data"]));" is not supporting .. any one have any idea to replace "writeRaw" in xml please. Thanks
I am tryng to do convert files details as base64 format and then wrireRaw into the xml file in php 5.1.2 and then covert it back to the original file format, but writeRaw is not supported in this php version. Is any other way to do. I tryed with xml "text" but it is nt working.
function writeb64XML($images, $savePath = 'test.xml', $indentSource = false, $xmlVersion = '1.0') {
$this->xml = new XMLWriter();
$this->xml->openURI($savePath);
if ($indentSource) {
$this->xml->setIndent(true);
}
$this->xml->startDocument($xmlVersion);
$this->xml->startElement('images');
$this->xml->startElement('url');
$this->xml->Text($images["file_name"]);
$this->xml->endElement();
$this->xml->startElement('source');
$this->xml->writeRaw(base64_encode($images["file_data"]));
$this->xml->endElement();
$this->xml->endElement();
$this->xml->endDocument();
return true;
}
i am using php 5.1.2 but "$this->xml->writeRaw(base64_encode($images["file_data"]));" is not supporting .. any one have any idea to replace "writeRaw" in xml please. Thanks