I have a little problem here. I try to convert an image into string base64, after that I want to save the string into blob in MySQL. So, the blob can be displayed on the mobile apps.
this is my code :
$data = file_get_contents($_FILES["picture"]["tmp_name"]);
$image = base64_encode($data);
I already successfully save the blob into MySQL, but I can not displayed the image in website.
<td> <img src="<?php echo base64_decode($user->getPicture()); ?>"></td>
because the result is : ������� and many more
Am I wrong ? Please correct me :)
data:image/png;base64,<?php echo base64_decode($user->getPicture()); ?>of course the mime type need to be relevant tot he image.. ieimage/jpegor whatever it actually is.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIA..."- you are missing thedata:image...(etc.)part it seems?