|
Posted by shadowman on 06/05/07 16:59
Jerry Stuckle wrote:
> shadowman wrote:
>> Mike P2 wrote:
>>
>>>
>>> What is your error reporting level set to? If you set it to E_ALL at
>>> the top of the script, does it complain about not being able to modify
>>> header information? I'm thinking that you might have some empty lines
>>> in myImageSave.php outside of the PHP block or before the <?php line
>>> in this file.
>>>
>>
>> No errors coming up in my log, but I checked the myImageSave.php file,
>> and sure enough, there were 4 linefeeds after the ?>
>>
>> Removing those fixed the problem. Thanks for your help! It makes
>> sense, although I never would have thought about that.
>
> In addition to what Mike said - you're script is very unsafe. What
> happens if you get two people who try to generate the files at almost
> exactly the same time? Since you're using the same filename for all of
> them, one will overwrite the other.
>
> You should generate a unique filename for each one, then delete it at
> the end (or after some period of time, anyway).
>
Roger that. I was really only creating the file on the server for
debugging purposes.
I think what I really want to do is skip that altogether. More along the
lines of:
$im = getPNG($data);
header('Content-Description: File Transfer');
header('Content-Type: application/force-download');
header('Content-Type: image/png');
header('Content-Disposition: attachment; filename=
"Graph.png"');
header("Content-Transfer-Encoding: binary");
ImagePNG($im);
Thanks for your help!
[Back to original message]
|