I have a small script that creates a small png. This is the part i'm having trouble with...
I've read that i need to add another header...PHP Code:header('Content-type: image/png');
imagepng($img);
imagedestroy($img);
Judging by what i assume it should do, i've come up with this...PHP Code:header ('Content-length: size');
But i'm guessing the header lines should come before imagepng and imagedestroy.PHP Code:$tmpfile = tempnam("/tmpdir", "img");
imagepng($img, $tmpfile);
header('Content-type: image/png');
header ('Content-length: filesize($tmpfile)');
imagedestroy($img);
How do i get the file size of my png?


Reply With Quote
