Use binary mode to write uploaded files [ci skip] See: http://stackoverflow.com/a/4988984/129798 for an explanation for why this is required for Ruby 1.9.
Merge pull request #11910 from brendon/master

Use binary mode to write uploaded files [ci skip]