in reply to Re: Uploading ms-word docs onto unix box using PERL
in thread Uploading ms-word docs onto unix box using PERL

The outline of the code that carries out the activity is
$q = CGI::new(); my $filename = $q->param('docname'); binmode($filename); if (open(OUTPUT, ">$output") || openError ()) { $Data = read( $filename, $buffer, BUFFER_SIZE ); }
Even with the introduction of the binmode($filename) statement , the problem persists..Please advice me....

Replies are listed 'Best First'.
Re^3: Uploading ms-word docs onto unix box using PERL
by davidrw (Prior) on Jul 11, 2005 at 17:38 UTC
    Ah -- CGI .. so that the client is windows and host unix doesn't really matter...
    anyways, i think you need to do binmode OUTPUT .. Read the entire (especially the very last part: Be sure to call binmode() on any handle that you create to write the uploaded file to disk.) "CREATING A FILE UPLOAD FIELD" section in the CGI docs. You may also be interested in the my $fh = $p->upload('docname') usage as well.