MySQL Forums
Forum List  »  PHP

Re: how to show an image from mysql table
Posted by: Rick James
Date: December 16, 2015 08:17PM

Small image? It is possible to encode "src" with base-64 data for
<img src="data:image/jpg;base64,$b64" ...>

Large image? Put out something like this if it in a file:
<img src="file:///$src" ...>

Large image? Have another program fetch it and echo it:
<img src="foo.php?fn=$ufn&...">
It needs a suitable header, such as
header('Content-type: image/jpeg');

(Those were taken from PHP code; adjust as needed.)

Options: ReplyQuote


Subject
Written By
Posted
Re: how to show an image from mysql table
December 16, 2015 08:17PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.