• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[HELP] Blob Field Image Issue

Hi guys,

I'm trying to print an image stored in a blob field. I read a lot of posts, but I can't be able to print image correctly.

In my view I have
img src="<?php echo site_url('ad/showimage/' . $row->user_id); ?>" alt="Foto Personale di <?php echo $row->nome; ?> <?php echo $row->cognome; ?>" title="Foto Personale di <?php echo $row->nome; ?> <?php echo $row->cognome; ?>" width="50" height="50" />
where user_id is the id of the record that contains blob.

In the showimage controller I have, in my 'modello' the query to retrieve the correct record

$id_user =  $this->uri->segment($this->uri->total_segments());
$row = $this->modello->get_data($id_user, "user", 'user_id');    
$data['row'] = $row;

And finally the view that print the image:

header("Content-type: jpeg");
print ($row->user_photo);

Nothing to do, I can't see image.

What'w wrong?! Can u help me, please?!

[eluser]Johan André[/eluser]
Check the content-type. I think it should be "image/jpg" or something similar...

Already check content-type image/jpg, image/jepg... nothing to do...

Thank you reply

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme ¬© 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.