in reply to Re: Re: Files are corrupted after uploading
in thread Files are corrupted after uploading

Actually, the error is not in the binmode command, this error is generated by $file_handle being undefined, and this is due to the fact that you are using this code : my $file_handle = $grab_file->upload("file$file_num");

this is right from the CGI.pm documentation:

The filename returned is also a file handle. You can read the contents of the file using standard Perl file reading calls.
so you don't need that line, $file is already the filehandle, so you set binmode $file and it should work.


He who asks will be a fool for five minutes, but he who doesn't ask will remain a fool for life.

Chady | http://chady.net/