Welcome Guest, Not a member yet? Register   Sign In
problem showing images from blob
#1

[eluser]socs[/eluser]
I have a strange issue where my image data that is stored in a blob is not getting displayed in the browser.

This is my view (only 1 image in the query result right now)...
<?php if ($imagequery->num_rows() > 0): ?>
<?php foreach($imagequery->result() as $irow): ?>
<?php header("Content-type: image/jpeg"); ?>
<?php print $irow->image ?>
<?php endforeach; ?>
<?php endif; ?>

I verified that the query is returning with data and using http fox I can see the browser thinks that the Content-type: is image/jpeg and has content but it doesn't display the image. browser just reflects my url back to me: http://localhost/codeigniter/index.php/image/25.

I also noticed that the browser get's a cache response after the initial get of 176 bytes for 0 bytes so not sure if it's a cache issue or I'm doing something else wrong ?
#2

[eluser]socs[/eluser]
solved.

looks like from an old thread http://ellislab.com/forums/viewthread/74780/
that the key is to addslashes before inserting the image and then
removeslashes before displaying it.




Theme © iAndrew 2016 - Forum software by © MyBB