Re: Execute script then output image.

From: Date: Thu, 11 Jul 2002 12:18:26 +0000
Subject: Re: Execute script then output image.
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-107107@lists.php.net to get a copy of this message
On Thu, 11 Jul 2002 22:01:03 +1000, you wrote: >> You need to output the correct content-type header for the image (eg >> image/gif), take it's size and output it as content-length, and >> suppress error reporting. Then output the image data. >There was a much simpler way. It just said the location of the file. > >I could use your method but the other one was much simpler. Is this what you meant? http://news.php.net/article.php?group=php.general&article=106348 http://news.php.net/article.php?group=php.general&article=106370 Looks like the same thing I suggested to me... $filename = "your/file.gif"; // output the correct content-type header header("Content-Type: image/gif"); // take it's size and output it as content-length header("Content-length:".filesize($filename)); // Then output the image data readfile($filename); djo

« previous php.general (#107107) next »