View saved BMP image in Oracle in PHP

Asked

Viewed 288 times

3

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

  • 2

    I have this answer here friend: http://answall.com/questions/14240/actualizr-campo-longblob-e-possivel/14255#14255, what changes there is the form of connection

1 answer

1

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

Another way is to convert the image to base 64 and display by embedding the base 64 code into the tag imgof html:

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

This way, on the tag img instead of inserting a URL as we would normally do, we insert the image itself.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.