Problem Displaying Images

From: Date: Sun, 25 Jun 2006 20:47:38 +0000
Subject: Problem Displaying Images
Groups: php.general 
Request: Send a blank email to php-general+get-238595@lists.php.net to get a copy of this message
I am trying to manage images with a web database application. It works fine with MySQL 5.0.17 and PHP 5.1.1. But when I port it to another machine that runs MySQL 3.23.54 and PHP 4.2.2, I have problems viewing the images retrieved from the database in the browser. The relevant part of the code is: $Result = mysql_fetch_array($Resource); if (!empty($Result["data"])) { header("Content-Type: {$Result['mime']}"); echo $Result["data"]; } But I see that some binary data is being echoed on to the client. But I guess it is corrupted in some way such that the browser cannot display it as an image. In fact I tried to save it as an image file, and the image viewer reported it as invalid format. Hope someone can shed light on this. Thanks in advance. Cheers, Prathap

« previous php.general (#238595) next »