public
Description: Treat an ActiveRecord model as a file attachment, storing its patch, size, content type, etc.
Homepage: http://weblog.techno-weenie.net
Clone URL: git://github.com/technoweenie/attachment_fu.git
Click here to lend your support to: attachment_fu and make a donation at www.pledgie.com !
add #binmode call to Tempfile [Eric Beland]

git-svn-id: 
http://svn.techno-weenie.net/projects/plugins/attachment_fu@2832 
567b1171-46fb-0310-a4c9-b4bef9110e78
technoweenie (author)
Mon Apr 02 15:09:52 -0700 2007
commit  dcd5c2a4b171dc9808c31ebb049942c5e0f1b369
tree    3d9bd85b68ed145060431fead0d9229ddc6ba657
parent  8fbfceecf60444eb75182687a3926d1f13fb5ab1
...
1
2
 
3
4
5
...
1
2
3
4
5
6
0
@@ -1,5 +1,6 @@
0
 * April 2, 2007 *
0
 
0
+* add #binmode call to Tempfile (note: ruby should be doing this!) [Eric Beland]
0
 * Check for current type of :thumbnails option.
0
 * allow customization of the S3 configuration file path with the :s3_config_path option.
0
 * Don't try to remove thumbnails if there aren't any. Closes #3 [ben stiglitz]
...
168
169
170
 
171
172
173
...
257
258
259
260
 
261
262
263
...
168
169
170
171
172
173
174
...
258
259
260
 
261
262
263
264
0
@@ -168,6 +168,7 @@ module Technoweenie # :nodoc:
0
       # Writes the given data to a new tempfile, returning the closed tempfile.
0
       def write_to_temp_file(data, temp_base_name)
0
         returning Tempfile.new(temp_base_name, Technoweenie::AttachmentFu.tempfile_path) do |tmp|
0
+ tmp.binmode
0
           tmp.write data
0
           tmp.close
0
         end
0
@@ -257,7 +258,7 @@ module Technoweenie # :nodoc:
0
           file_data.rewind
0
           self.temp_data = file_data.read
0
         else
0
- self.temp_path = file_data.path
0
+ self.temp_path = file_data.path
0
         end
0
       end
0
 

Comments

    No one has commented yet.