lib/carrierwave/storage/sftp.rb in carrierwave-ftp-0.2.4 vs lib/carrierwave/storage/sftp.rb in carrierwave-ftp-0.2.5
- old
+ new
@@ -34,9 +34,16 @@
def filename(options = {})
url.gsub(/.*\/(.*?$)/, '\1')
end
+ def to_file
+ temp_file = Tempfile.new(filename)
+ temp_file.binmode
+ temp_file.write file.body
+ temp_file
+ end
+
def size
size = nil
connection do |sftp|
size = sftp.stat!(full_path).size