View BMP image saved in Oracle in PHP

3

How to do to recover a BMP image saved in an Oracle database and display it on the screen Unfortunately I can not store the image files on the server and save the database only the path.

    
asked by anonymous 02.05.2014 / 22:21

1 answer

1

There are some ways to do this without saving the image to the server, one of them is how FCCDias explains in Update LONGBLOB field possible?

Another way is to convert the image to base 64 and display embedding base code 64 in the img of html tag:

$imagem_64 = base64_encode($res['imagem']); //$res é o resultado de sua consulta ao Oracle
echo '<img src="data:image/bmp;base64,'+$imagem_64+'" />';

In this way, in the img tag instead of entering a URL as we would normally do, we insert the image itself.

    
06.05.2014 / 13:48