rails/rails — pull request #11910 by brendon (2013-08-16 02:11:01+00:00)
Title: Use binary mode to write uploaded files

See: http://stackoverflow.com/a/4988984/129798 for an explanation for why this is required for Ruby 1.9.