Sha256: 64bc2f9ce29a65c493f06bca7c5575f3dcd6e8269e301a324f4518638a5a1215

Contents?: true

Size: 1.52 KB

Versions: 6

Compression:

Stored size: 1.52 KB

Contents

module Fog
  module AWS
    class Storage
      class Real

        # Upload a part for a multipart upload
        #
        # ==== Parameters
        # * bucket_name<~String> - Name of bucket to add part to
        # * object_name<~String> - Name of object to add part to
        # * upload_id<~String> - Id of upload to add part to
        # * part_number<~String> - Index of part in upload
        # * data<~File||String> - Content for part
        # * options<~Hash>:
        #   * 'Content-MD5'<~String> - Base64 encoded 128-bit MD5 digest of message
        #
        # ==== Returns
        # * response<~Excon::Response>:
        #   * headers<~Hash>:
        #     * 'ETag'<~String> - etag of new object (will be needed to complete upload)
        #
        # ==== See Also
        # http://docs.amazonwebservices.com/AmazonS3/latest/API/mpUploadUploadPart.html
        #
        def upload_part(bucket_name, object_name, upload_id, part_number, data, options = {})
          data = Fog::Storage.parse_data(data)
          headers = options
          headers['Content-Length'] = data[:headers]['Content-Length']
          request({
            :body       => data[:body],
            :expects    => 200,
            :headers    => headers,
            :host       => "#{bucket_name}.#{@host}",
            :method     => 'PUT',
            :path       => CGI.escape(object_name),
            :query      => {'uploadId' => upload_id, 'partNumber' => part_number}
          })
        end

      end # Real
    end # Storage
  end # AWS
end # Fog

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
fog-0.8.2 lib/fog/storage/requests/aws/upload_part.rb
fog-0.8.1 lib/fog/storage/requests/aws/upload_part.rb
fog-0.8.0 lib/fog/storage/requests/aws/upload_part.rb
fog-0.7.2 lib/fog/storage/requests/aws/upload_part.rb
fog-0.7.1 lib/fog/storage/requests/aws/upload_part.rb
fog-0.7.0 lib/fog/storage/requests/aws/upload_part.rb