June 20th, 2013, 01:12 AM
Image download from database
i know an image should not be stored in a db, just the link, but I just want to test it and it should work.
Using phpmyadmin i have checked that image was successfully uploaded. But if i use my script, it is not displayed.
same effect, if i try to download the image via html
$sqlS = "SELECT upl_file, upl_type FROM ".$tab;
$sqlS.=" WHERE ID = '".mysql_real_escape_string($_GET['ID'])."'";
$data = mysql_result($result,0, 0);
$typ = mysql_result($result,0, 1);
other mime types can be downloaded, but image is never displayed with my script, just get a little icon "image" displayed.
</h2>Display image from database</h2>
What do i have to do to download an image successfully?
Thank you in advance for your support.
June 20th, 2013, 01:25 AM
You need to do a little more debugging.
Remove the header() call from your script and call the image scripts URL directly, and you'll be able to see any error messages that are shown (oh, be sure that you have error reporting turned on as high as you can). That way you'll see the errors that are happening and you'll be able to fix them.
June 20th, 2013, 01:34 AM
Originally Posted by Catacaustic
thank you for your quick help.
The mistake was the following, not viewable for you, because I thought it was not necessary to list the code
without comment sign the image is not displayed, now it works!