PHP Classes
elePHPant
Icontem

Binary XML: Generate and parse XML documents with binary files

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Info   View files View files (7)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2009-07-11 (5 years ago) RSS 2.0 feedNot yet rated by the usersTotal: 451 All time: 5,680 This week: 1,233Up
Version License PHP version Categories  
binary_image_in_xml 1.0GNU General Publi...5.1.2XML, PHP 5, Files and Folders
Description Author  

This class can be used to generate and parse XML documents with binary files.

It can take a list of files and generate a XML document that includes the data of files using base64 encoding.

The class can also do the opposite, i.e. parse a previously generated XML document and recreate files contained in the document.

Picture of Sudhir Chauhan
Name: Sudhir Chauhan <contact>
Classes: 5 packages by
Country: India India
Age: 36
All time rank: 1687 in India India
Week rank: 316 Down29 in India India Down

Details provided by the author  
Created by chauhansudhir@gmail.com
* This is an example to demonstatrate how we can embed binary in XML. Here an array of images path
* given to generateBinaryXML method and XML document saved in the given path. savePath should be a
* physical path because images are large in size and results large XML document.



create output folder and implement the following code


require('BinaryXML.php');
$binaryXML = new BinaryXML();
$savePath = 'test.xml';
$images = Array('1.jpg', '2.jpg', '3.jpg', '4.jpg');
$result = $binaryXML->generateBinaryXML($images, $savePath, true, '1.0');
if ($result) {
	print 'XML generated';
}
else {
	print 'XML not generated';
}

# parse XML and saves images to output folder
$binaryXML->parseXML($savePath, 'output/');  
  Files folder image Files  
File Role Description
Accessible without login Image file 3.jpg Icon 3.jpg
Accessible without login Image file 1.jpg Icon Sample file for conversion
Accessible without login Plain text file readme.txt Doc. readme.txt
Accessible without login Plain text file index.php Example Example index.php
Plain text file BinaryXML.php Class Class that add or parse images in binary files
Accessible without login Image file 2.jpg Icon 2.jpg
Accessible without login Image file 4.jpg Icon 4.jpg

 Version Control Unique User Downloads Download Rankings  
 0%Total:451All time:5,680
 This week:0This week:1,233Up