in reply to Re: File uploads, CGI::Application, File::TEMP and Uploadify
in thread File uploads, CGI::Application, File::TEMP and Uploadify

Hey, you rock! Thank you for the advice! Do I need to binmode this somehow? I'm uploding zip files from windows, the file gets created but I can't unzip it, it claims to be corrupt.
while (read ($fh, $buffer, $buffsize)) { print $tmp $buffer; $bytes_retrieved += bufsize; }

Replies are listed 'Best First'.
Re^3: File uploads, CGI::Application, File::TEMP and Uploadify
by almut (Canon) on May 10, 2010 at 09:51 UTC
    Do I need to binmode this somehow?

    The documentation says the temp file is already being opened in binary mode, so theoretically, there should be no need to binmode it yourself.  You can of course still try it, though... (just say binmode $tmp; before printing to it.)  Ditto for the file handle $rh that you're reading from.