diff --git a/lib/fog/local/models/storage/file.rb b/lib/fog/local/models/storage/file.rb index 97cea911f..36c9701a7 100644 --- a/lib/fog/local/models/storage/file.rb +++ b/lib/fog/local/models/storage/file.rb @@ -45,7 +45,11 @@ module Fog def save(options = {}) requires :body, :directory, :key file = ::File.new(path, 'w') - file.write(body) + if body.is_a?(String) + file.write(body) + else + file.write(body.read) + end file.close merge_attributes( :content_length => ::File.size(path),