Jump to content

Recommended Posts

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

And I show the image like this

[code]
  
//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;
}
[/code]


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

what is the problem??

tanks

Link to comment
https://forums.phpfreaks.com/topic/4314-problemn-showing-images-from-database/
Share on other sites

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]
[!--quoteo(post=352456:date=Mar 7 2006, 06:29 AM:name=ToonMariner)--][div class=\'quotetop\']QUOTE(ToonMariner @ Mar 7 2006, 06:29 AM) [snapback]352456[/snapback][/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] => )
It's only 1 pic

//my function to upload the file


[code]

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);
    }  
  }
}

[/code]

no diference if I refresh the page....

it's seem that the image didn't upload complete
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.