lib/fog/aws/models/storage/file.rb in fog-0.3.19 vs lib/fog/aws/models/storage/file.rb in fog-0.3.20

- old
+ new

@@ -96,9 +96,14 @@ options['Expires'] = expires if expires options['x-amz-storage-class'] = storage_class if storage_class 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 def url(expires) requires :key