Jump to content


Photo

problemn showing images from database


  • Please log in to reply
6 replies to this topic

#1 wolves

wolves
  • Members
  • PipPipPip
  • Advanced Member
  • 65 posts

Posted 07 March 2006 - 11:10 AM

Hi, I have a table to store my images....
I store the content and the image type,

And I show the image like this

  
//the id of the image
  $id            = $_GET["id"];

 //database connection
  $db  = connect();
  
  //query
  $res = lookInfoSql($db,"VAD0362","*","CODSEQ = ?",$id);

  if ($res) {    
  //my image type
  $image_type = $res["FILE_TYPE"];
     
//my image content
    $image = $res["ds_arquivo"];
    Header("Content-type: $image_type");
    print $image;
}


It's works well, but some images don't apper complete....

what is the problem??

tanks



#2 ToonMariner

ToonMariner
  • Members
  • PipPipPip
  • Advanced Member
  • 3,342 posts
  • LocationNewcastle upon Tyne, UK

Posted 07 March 2006 - 11:29 AM

is it just gif's that don't display properly?

if so check which gdlibrary you have installed - there was a period where gif support was not included some check out [a href=\"http://uk.php.net/manual/en/function.gd-info.php\" target=\"_blank\"]gd info[/a]
follow me on twitter @PHPsycho

#3 wolves

wolves
  • Members
  • PipPipPip
  • Advanced Member
  • 65 posts

Posted 07 March 2006 - 11:47 AM

[!--quoteo(post=352456:date=Mar 7 2006, 06:29 AM:name=ToonMariner)--][div class=\'quotetop\']QUOTE(ToonMariner @ Mar 7 2006, 06:29 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
is it just gif's that don't display properly?

if so check which gdlibrary you have installed - there was a period where gif support was not included some check out [a href=\"http://uk.php.net/manual/en/function.gd-info.php\" target=\"_blank\"]gd info[/a]
[/quote]


Array ( [GD Version] => bundled (2.0.28 compatible) [FreeType Support] => 1 [FreeType Linkage] => with freetype [T1Lib Support] => 1 [GIF Read Support] => 1 [GIF Create Support] => 1 [JPG Support] => 1 [PNG Support] => 1 [WBMP Support] => 1 [XPM Support] => [XBM Support] => 1 [JIS-mapped Japanese Font Support] => )

#4 ToonMariner

ToonMariner
  • Members
  • PipPipPip
  • Advanced Member
  • 3,342 posts
  • LocationNewcastle upon Tyne, UK

Posted 07 March 2006 - 12:01 PM

hmmm


maybe an execution time thing - you outputting lost of pics? is there any difference if you refresh the page?

follow me on twitter @PHPsycho

#5 wolves

wolves
  • Members
  • PipPipPip
  • Advanced Member
  • 65 posts

Posted 07 March 2006 - 06:18 PM

It's only 1 pic

//my function to upload the file



function getFileUploaded($name) {
  
  if($_FILES) {
    
     if(is_uploaded_file($_FILES[$name]["tmp_name"])) {
/*I use fopen, But I post fope, because can't post fopen.... strange thing.....*/                        
                  $userfile = fread(fope($_FILES[$name]["tmp_name"], "r"),filesize ($_FILES[$name]["tmp_name"]));                               

       $file_name = $_FILES[$name]["name"];
       $file_size = $_FILES[$name]["size"];
       $file_type = $_FILES[$name]["type"];                     
       

       return  Array("name" => $file_name, "type" => $file_type, "size" => $file_size, "toStore" => $userfile);
    }   
  }
}


no diference if I refresh the page....

it's seem that the image didn't upload complete

#6 wolves

wolves
  • Members
  • PipPipPip
  • Advanced Member
  • 65 posts

Posted 08 March 2006 - 02:47 PM

database is mssql

#7 wolves

wolves
  • Members
  • PipPipPip
  • Advanced Member
  • 65 posts

Posted 10 March 2006 - 11:19 AM

anyone?





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users