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

y, as Joost said, bunmode is a likely culprit..

But what method/protocol are you using (http/ftp/scp/nfs/etc)? Can we see code? If the unix box directory is available to the windows box (my best guess as to what you're doing), are you using File::Copy? That would avoid you needing to read/write yourself.
  • Comment on Re: Uploading ms-word docs onto unix box using PERL

Replies are listed 'Best First'.
Re^2: Uploading ms-word docs onto unix box using PERL
by asifk1981 (Novice) on Jul 11, 2005 at 17:04 UTC
    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....
      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.