I’m new to blobs, so I’m hoping for a little direction to save hours more of fruitless brute-force attempts.
echo '<img src="data:image/jpeg;base64,'.base64_encode( $row['Photo'] ).'"==/>';
I’m used to appending to the dom in the following way:
var photo = document.createElement('img'); photo.src = X; document.body.insertBefore(photo,document.body.firstChild);
But presumably some decoding is required on client side.
I’d be happy with a link to another stackoverflow question if you know a fitting one.
Most of the stackoverflow questions on the subject I have found (e.g.) get to decoding or the echoing, but not an explicit treatment of including that image in the DOM.
Any help appreciated.
The solution, as given by @CertainPerformance, is a trivial variation on the linked solutions given elsewhere.
Echoing back the following allows for appending to the DOM as expected:
echo 'data:image/jpeg;base64,'.base64_encode( $row['Photo'] );