quote:
Originally posted by MeEtc
The problem is, imagepng returns a boolean value for if the operation is successful, and not the data for the image. I have no idea if its possible to capture the output buffer to a variable or not, or if this order of events would even be possible.
It's possible, I do it all the time...
code:
ob_start();
$success = imagepng($main_image);
$imgdata = ob_get_clean();
imagedestroy($main_image);
if(!$success) {
die('Error creating image');
}
// ... sql query and headers and stuff ...
echo $imgdata;
file_put_contents($imgfile, $imgdata);
quote:
On a side note, why are .xls files not allowed to be uploaded?
Fixed.