View Single Post
Old 21 October 2014, 22:52   #7
yssing
Registered User
 
Join Date: Oct 2012
Location: Denmark
Posts: 14
<?php

$handle = fopen("uploads/something.library", "r");
if ($handle) {
while (!feof($handle)) {
$hex = bin2hex(fread ($handle , 4 ));
print $hex."\n";
}
fclose($handle);
}
?>

http://php.net/manual/en/function.bin2hex.php

php has a method for doing just that

What I would do to save the different versions of the library would be either:
1) Save the library in the database as a blob, that way you can SQL to most operations afterwards.
2) Zip pack the library and name the file with the name of the library and then the version eg. somelib_v45_12.zip and then save the name and URL in the database.
3) Create a folder for library and in that flder create subfolders containing the library versions and save the resulting URL and name in the database.

I would always save metadata in the database, it makes it easy and fast to search for information about the libraries.
yssing is offline  
 
Page generated in 0.03926 seconds with 10 queries