1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[storage|rackspace] fix streaming bug.

Bug was causing whole file to load to memory before upload
thanks meskyanichi
This commit is contained in:
geemus 2011-03-10 09:50:19 -08:00
parent ac2610c85f
commit 9bdf1ed585

View file

@ -42,14 +42,14 @@ module Fog
if data.is_a?(String)
metadata[:body] = data
metadata[:headers]['Content-Length'] = metadata[:body].size.to_s
metadata[:headers]['Content-Length'] = metadata[:body].size
else
filename = ::File.basename(data.path)
unless (mime_types = MIME::Types.of(filename)).empty?
metadata[:headers]['Content-Type'] = mime_types.first.content_type
end
metadata[:body] = data.read
metadata[:headers]['Content-Length'] = ::File.size(data.path).to_s
metadata[:body] = data
metadata[:headers]['Content-Length'] = ::File.size(data.path)
end
# metadata[:headers]['Content-MD5'] = Base64.encode64(Digest::MD5.digest(metadata[:body])).strip
metadata