in reply to gd and internet explorer

You probably don't need binmode unless your script is running in Windows. I doubt it is because you referenced /tmp. If that is the case, comment out the binmode lines below. When working with binary files, use read() to have better control over memory usage.

open (IN, "<$path/$filename.tmp") || die $!; binmode IN; open (OUT, ">$path/$filename.jpg") || die $!; binmode OUT; print OUT $buf while read IN, $buf, 8192; close IN; close OUT;
P.S.
If you are transfering that file via FTP from the server to the windows box to test opening it . . you did remeber to set FTP to binary more by issuing "bin" before the get right?

Replies are listed 'Best First'.
Re: Re: gd and internet explorer
by Jenda (Abbot) on Feb 11, 2003 at 20:18 UTC

    If the file is binary you should binmode() no matter where you run. Think about porting the script!

    Plus with the advent of LAYERs in Perl 5.8 binmode() stops being a NOOP under Unix and you may actually HAVE to use binmode() even if you are running a unix.

    Jenda

Re: Re: gd and internet explorer
by Anonymous Monk on Feb 11, 2003 at 21:06 UTC
    This is a web page app, not a ftp app... I think I have one more thing up my sleve... (perhaps an img tag will get it to work, because I *was* able to get that to work the last time I generated an image... ) thanks for the tid bits anyways... very strange behavior