Method: Fog::Storage::Softlayer::File#save

Defined in:
lib/fog/softlayer/models/storage/file.rb

#save(options = {}) ⇒ Object



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/fog/softlayer/models/storage/file.rb', line 92

def save(options = {})
  requires :body, :directory, :key
  options['Content-Type'] = content_type if content_type
  options['Content-Disposition'] = content_disposition if content_disposition
  options['Access-Control-Allow-Origin'] = access_control_allow_origin if access_control_allow_origin
  options['Origin'] = origin if origin
  options.merge!()

  data = service.put_object(directory.key, key, body, options)
  update_attributes_from(data)
  

  self.content_length = Fog::Storage.get_body_size(body)
  self.content_type ||= Fog::Storage.get_content_type(body)
  true
end