]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/trace_controller.rb
Use binary mode for trace files
[rails.git] / app / controllers / trace_controller.rb
index 05f97bf0d507a667973fbf6405263af44d328c53..4b138bdaecf5d52f22c08faec64671516bda6d92 100644 (file)
@@ -368,7 +368,7 @@ private
     filename = "/tmp/#{rand}"
 
     # ...and save the uploaded file to that location
     filename = "/tmp/#{rand}"
 
     # ...and save the uploaded file to that location
-    File.open(filename, "w") { |f| f.write(file.read) }
+    File.open(filename, "wb") { |f| f.write(file.read) }
 
     # Create the trace object, falsely marked as already
     # inserted to stop the import daemon trying to load it
 
     # Create the trace object, falsely marked as already
     # inserted to stop the import daemon trying to load it