[storage] correctly set content_length on save

This commit is contained in:
geemus 2010-11-17 14:54:48 -08:00
parent 3eb9ca98b8
commit 00171dfa8a
3 changed files with 15 additions and 0 deletions

View File

@ -98,6 +98,11 @@ module Fog
data = connection.put_object(directory.key, @key, @body, options)
merge_attributes(data.headers)
if body.is_a?(String)
self.content_length = body.size
else
self.content_length = ::File.size(body.path)
end
true
end

View File

@ -100,6 +100,11 @@ module Fog
data = connection.put_object(directory.key, @key, @body, options)
merge_attributes(data.headers)
if body.is_a?(String)
self.content_length = body.size
else
self.content_length = ::File.size(body.path)
end
true
end

View File

@ -52,6 +52,11 @@ module Fog
requires :body, :directory, :key
data = connection.put_object(directory.key, @key, @body, options)
merge_attributes(data.headers)
if body.is_a?(String)
self.content_length = body.size
else
self.content_length = ::File.size(body.path)
end
true
end