having a big trouble trying to make this blob saved to a file and load it as an image.
Using SQLite Manager (Firefox Add-on) I was able to "Save As" a file with the content of my image BLOB. The result is a strange (for me) code.
Since I can´t post the "source of the file", I'm attaching one png with the example.
In my Mac, the saved file has no extention but I can view the image it produces as thumbnail.
So I'm trying to achieve the same result saving one file, but all I get is a 16 bytes document I can't read...
$pic = fopen('pics/thumbnails/pic_'.$id.'', 'w');
fwrite($pic, base64_encode($theFile));
fclose($pic);
* EDIT *
$theFile = shell_exec("sqlite3 AddressBookImages.sqlitedb 'select data from ABThumbnailImage where record_id = ".$id."'");
if($theFile != '') {
file_put_contents('pics/thumbnails/pic_'.$id.'.jpg', $theFile);
}