<?php
$this->xml = simplexml_load_file('images.xml');
foreach ($this->xml->Listing->Picture as $picture) {
$filename = $this->cleanBrackets($picture->PictureID) . ".jpg";
//open file for writing
$this->image_handle = fopen("xml/images/". $filename , "wb+") or die('error file write');
$data = base64_decode(trim($picture->BinaryData));
@fwrite($this->image_handle,$data);
fclose($this->image_handle);
} // end foreach
?>
Extract base64 encoded images from XML file
Posted by peterdillon@gmail.com on September 23, 2010
http://www.peter-dillon.com/extract-base64-encoded-images-from-xml-file/
Previous Post
Add ftp port 21 to iptables
Add ftp port 21 to iptables
Next Post
Rails Playground kill fcgi process
Rails Playground kill fcgi process
Comments are closed.