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

#1
[eluser]daweb[/eluser]
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
Code:
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

Code:
$id_user =  $this->uri->segment($this->uri->total_segments());
$row = $this->modello->get_data($id_user, "user", 'user_id');    
$data['row'] = $row;
$this->load->view('admin/iscritti/showimage_view',$data);

And finally the view that print the image:

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

Nothing to do, I can't see image.

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

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

#3
[eluser]daweb[/eluser]
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.