Skip to content

Commit

Permalink
Use wand :original_filename override
Browse files Browse the repository at this point in the history
When the attachment is a temporary file from an upload it will
not have a file extension more than likely. This means that MIME
cannot determine the file and we fall down to 'file' command more
than we should have to.

requires raykrueger/wand@4268216
  • Loading branch information
raykrueger committed Nov 15, 2010
1 parent 0f743ad commit 441643a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/joint.rb
Expand Up @@ -44,7 +44,7 @@ def #{name}=(file)
else
self["#{name}_id"] = BSON::ObjectId.new if self["#{name}_id"].nil?
self["#{name}_size"] = File.size(file)
self["#{name}_type"] = Wand.wave(file.path)
self["#{name}_type"] = Wand.wave(file.path, :original_filename => Joint.file_name(file))
self["#{name}_name"] = Joint.file_name(file)
assigned_attachments[:#{name}] = file
nil_attachments.delete(:#{name})
Expand Down

0 comments on commit 441643a

Please sign in to comment.