|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-03-01 11:19 UTC] rupert at ditzed dot org
I was previously using fopen() and fpassthru to grab a gif image and pass it to the browser. This worked fine.
Then I installed PHP4.0.4pl1 and the image that now gets returned is garbled (the image appears to be the right dimensions, but filesize shows 150 bytes, not 406 bytes which is what the image actually is).
On any html page the following line was installed:
<IMG src="track.php?ref=12345">
track.php then looks like this:
<?
$image = fopen ("track.gif", "r");
fpassthru ($image);
?>
I tried the same with the readfile() function, as follows:
<?
readfile("track.gif");
?>
same result.
Other file I/O appears to be fine.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 21:00:02 2025 UTC |
Try adding 'b' into fopen: $image=fopen("track.gif", "rb"); Check the manual page for fopen: http://www.php.net/fopen --Jani