![]() |
problem showing images from blob - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: problem showing images from blob (/showthread.php?tid=10302) |
problem showing images from blob - El Forum - 07-25-2008 [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 ? problem showing images from blob - El Forum - 07-25-2008 [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. |