RE: [PHP] Trouble sending an image's contents as output using hea der Content-Type...

From: Date: Mon, 10 Nov 2003 02:19:28 +0000
Subject: RE: [PHP] Trouble sending an image's contents as output using hea der Content-Type...
Groups: php.general 
Request: Send a blank email to php-general+get-169004@lists.php.net to get a copy of this message
Maybe there's an error with _generateThumbnail() ? Do you know for certain that _generateThumbnail() works okay ? Martin -----Original Message----- Hi all: I have a page with a img tag: <img src="/getthumbnail.php?fileid=12230983"> The script getthumbnail.php searchs for a thumbnail of the specified image id; if not thumbnail exists, the script creates one; and then using readfile() and header() functions flushes it contents to the browser. But it fails. The code is very simple: header('Content-Type: image/jpeg'); // I'm testing with JPEGs // If the thumbnails exists (or it gets generated this time) if ($path = _generateThumbnail($_GET['fileid'])) @readfile($path); else @readfile(GENERIC_THUMBNAIL); // A constant to a generic icon Any tips? Manu.

« previous php.general (#169004) next »