Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Quick fix in Upfile

git-svn-id: https://svn.thoughtbot.com/plugins/paperclip/trunk@304 7bbfaf0e-4d1d-0410-9690-a8bb5f8ef2aa
  • Loading branch information...
commit b6ccf06cf21bb487a15a0000b6b64f80adc36c1d 1 parent 5f2b2cd
jyurek authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/paperclip/upfile.rb
View
2  lib/paperclip/upfile.rb
@@ -6,7 +6,7 @@ module Upfile
# Infer the MIME-type of the file from the extension.
def content_type
- type = self.path.match(/\.(\w+)$/)[1] || "data"
+ type = self.path.match(/\.(\w+)$/)[1] rescue "octet-stream"
case type
when "jpg", "png", "gif" then "image/#{type}"
when "txt", "csv", "xml", "html", "htm", "css", "js" then "text/#{type}"
Please sign in to comment.
Something went wrong with that request. Please try again.