[Home]WikiBugs/UploadOnWindowsNeedsBinmode

UseModWiki | WikiBugs | RecentChanges | Preferences

Fixed in 1.0.1 --MarkusLude

If your web server is running on a Windows OS, uploads of binary files will be corrupted. This can be fixed by adding a line to the SaveUpload() function. Right after the line

 open UPLOADFILE, ">$UploadDir$filename";

add the line

 binmode UPLOADFILE;

And a question: why isn't the return status of the open() checked? You might consider what can happen if it fails...

--DavidWall

What can happen if it fails? I don't think any modern operating system will have a problem with writing to an invalid filehandle. (I suspect Perl may even check for this case.) Still, it might be nice to print an informative error message in this case, so I will probably check the status in 1.1. --CliffordAdams

Oops, I didn't even notice WikiBugs/FileUploadManglesFile, even though I looked for such a page. --DavidWall


UseModWiki | WikiBugs | RecentChanges | Preferences
Edit text of this page | View other revisions | Search MetaWiki
Last edited August 30, 2007 6:45 pm by MarkusLude (diff)
Search: