http://www.perlmonks.org?node_id=11737

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I have a script to read a file from an HTML upload field. The files are .pdf's and using the same script, the .pdf does not get uploaded right on NT but does on a Linux server. When trying to open the uploaded file, Acrobat gives "unrecognized token" and then "there were several parsing errors", and doesn't open it. Works great on Linux. ANybody have an idea why? Code below.
undef $BytesRead; undef $Buffer; while ($Bytes = read($File_Handle,$Buffer,1024)) { $BytesRead += $Bytes; print OUTFILE $Buffer; } push(@Files_Written, "$SAVE_DIRECTORY\/$Filename"); $TOTAL_BYTES += $BytesRead; $Confirmation{$File_Handle} = $BytesRead; close($File_Handle); close(OUTFILE); chmod (0666, "$SAVE_DIRECTORY\/$Filename");
Thanks! Str