aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2012-12-05 18:27:01 +0000
committerLouise Crow <louise.crow@gmail.com>2012-12-05 18:27:01 +0000
commitb1d2c3d5553cffbb87b008982b70f1d1d5203af1 (patch)
tree792c1612e0af2b28a5879ef36cfb7382557334a1
parent3729f2053d4c04396d440a9c368bed174e9c9605 (diff)
Write to the temp file in binary mode - we may be writing binary content, such as a PDF file.
-rw-r--r--app/models/incoming_message.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb
index d976d318b..746c878fc 100644
--- a/app/models/incoming_message.rb
+++ b/app/models/incoming_message.rb
@@ -711,6 +711,7 @@ class IncomingMessage < ActiveRecord::Base
text += body + "\n\n"
else
tempfile = Tempfile.new('foiextract')
+ tempfile.binmode
tempfile.print body
tempfile.flush
default_params = { :append_to => text, :binary_output => false }