lib/carrierwave/storage/ftp.rb in carrierwave-ftp-0.4.0 vs lib/carrierwave/storage/ftp.rb in carrierwave-ftp-0.4.1
- old
+ new
@@ -75,11 +75,11 @@
file.close
content
end
def content_type
- @content_type || file.content_type
+ @content_type || inferred_content_type
end
def content_type=(new_content_type)
@content_type = new_content_type
end
@@ -91,9 +91,13 @@
end
rescue
end
private
+
+ def inferred_content_type
+ SanitizedFile.new(path).content_type
+ end
def connection
if @uploader.ftp_tls
ftp = ExFTPTLS.new
ftp.ssl_context = DoubleBagFTPS.create_ssl_context(:verify_mode => OpenSSL::SSL::VERIFY_NONE)