Re: Display BLOB Image
| From: | Steve Cayford | Date: | Thu, 06 Dec 2001 21:36:48 +0000 |
| Subject: | Re: Display BLOB Image | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-76945@lists.php.net to get a copy of this message | ||
This is what I used to do what you're trying:
header("Content-Type: image/" . $imagetype); // $imagetype is jpeg or gif
header("Content-Length: " . strlen($image));
echo $image;
Note that "Type" is capitalized in "Content-Type", and include the "Content-Length" as well.
-Steve
On Thursday, December 6, 2001, at 02:45 PM, phantom wrote:
I have successfully placed images (jpg,gif,png) into a MySQL database BLOB field, now I want to be able to pull the data out and diplay it. based on tutorial at http://www.zdnet.com/devhead/stories/articles/0,4413,2644827,00.html after Querying the DB I have the following lines: $ImgFile = mysql_result($Results,0,ImgFile); \\ image data; $ImgType = mysql_result($Results,0,ImgType); \\ image type (image/jpeg, image/gif); header("Content-type: ${ImgType}"); echo "$ImgFile"; Problem: This method, when it pulls up an image, it shows no image but a bunch of greek code. Example http://www.phantomcougar.com/strawberrypie_com/mem/show_img.php?PNum=8 ((be sure to view page source) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net