Hi all.

I have some code that writes PNG data to a file, that works under Linux but not under Windows.

The code:

my $png_data = get($http_request_string);
open ( OUTPUT_HANDLE, "> $path/top_n.png" );
print OUTPUT_HANDLE $png_data;
close OUTPUT_HANDLE;

Pretty simple, eh?

A web server creates the graph ( legacy graphing system that works fine ), and returns it as a PNG file. Under Linux, I get a valid PNG file from the above, but under Windows, the file won't open. While trying to open it in various apps, one of them said that the file was corrupted by a conversion to ASCII.

Should the above code work under Windows? How do I write binary data to a file so it works?

--
Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: [EMAIL PROTECTED]
website: http://www.nusconsulting.com.au

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to