Class AWS::S3::MultipartUpload
In: lib/aws/s3/multipart_upload.rb
Parent: Object

Represents a multipart upload to an S3 object. See {S3Object#multipart_upload} for a convenient way to initiate a multipart upload.

Methods

==   abort   aborted?   add_part   bucket   cancel   close   complete   completed_parts   copy_part   delete   eql?   exists?   initiator   inspect   inspect   new   owner   parts   reduced_redundancy?   storage_class  

Included Modules

Core::Model

External Aliases

id -> upload_id

Attributes

id  [R]  @return [String] Returns the upload id.
object  [R]  @return [S3Object] Returns the object this upload is intended for.

Public Class methods

Public Instance methods

@return [Boolean] Returns true if both multipart uploads

  represent the same object and upload.

Aborts the upload. After a multipart upload is aborted, no additional parts can be uploaded using that upload ID. The storage consumed by any previously uploaded parts will be freed. However, if any part uploads are currently in progress, those part uploads might or might not succeed. As a result, it might be necessary to abort a given multipart upload multiple times in order to completely free all storage consumed by all parts. @return [nil]

@return [Boolean] True if the upload has been aborted. @see abort

Uploads a part.

@overload add_part(data, options = {})

  @param data The data to upload.
    Valid values include:

      * A string
      * A Pathname object
      * Any object responding to `read` and `eof?`; the object
        must support the following access methods:

            read                     # all at once
            read(length) until eof?  # in chunks

        If you specify data this way, you must also include
        the `:content_length` option.

  @param [Hash] options Additional options for the upload.

  @option options [Integer] :content_length If provided,
    this option must match the total number of bytes written
    to S3 during the operation.  This option is required if
    `:data` is an IO-like object without a `size` method.

@overload add_part(options)

  @param [Hash] options Options for the upload.  Either
    `:data` or `:file` is required.

  @option options :data The data to upload.  Valid values
    include:

      * A string
      * A Pathname object
      * Any object responding to `read` and `eof?`; the object
        must support the following access methods:

             read                     # all at once
             read(length) until eof?  # in chunks

        If you specify data this way, you must also include
        the `:content_length` option.

  @option options [String] :file Can be specified instead of
    `:data`; its value specifies the path of a file to
    upload.

  @option options [Integer] :content_length If provided,
    this option must match the total number of bytes written
    to S3 during the operation.  This option is required if
    `:data` is an IO-like object without a `size` method.

  @option options [Integer] :part_number The part number.
cancel()

Alias for abort

Completes the upload or aborts it if no parts have been uploaded yet. Does nothing if the upload has already been aborted.

@return [S3Object, ObjectVersion] If the bucket has versioning

  enabled, returns the {ObjectVersion} representing the
  version that was uploaded.  If versioning is disabled,
  returns the object.  If no upload was attempted (e.g. if it
  was aborted or if no parts were uploaded), returns `nil`.

Completes the upload by assembling previously uploaded parts.

@return [S3Object, ObjectVersion] If the bucket has versioning

  enabled, returns the {ObjectVersion} representing the
  version that was uploaded.  If versioning is disabled,
  returns the object.

@api private

Copies a part.

  @param [string] copy_source Full S3 name of source, ie bucket/key

  @param [Hash] options Additional options for the copy.

  @option options [Integer] :part_number The part number.

  @option options [Integer] :copy_source_range Range of bytes to copy, ie bytes=0-45687
delete()

Alias for abort

eql?(other)

Alias for #==

@return [Boolean] True if the upload exists.

@return The upload initiator. This object will have `:id`

  and `:display_name` methods; if the initiator is an IAM
  user, the `:id` method will return the ARN of the user, and
  if the initiator is an AWS account, this method will return
  the same data as {#owner}.

@api private

@return The upload owner. This object will have `:id`

  and `:display_name` methods.

@return [UploadedPartCollection] A collection representing

  the parts that have been uploaded to S3 for this upload.

@return [Boolean] True if the uploaded object will be stored

  with reduced redundancy.

@return [Symbol] The class of storage used to store the

  uploaded object.  Possible values:

  * `:standard`
  * `:reduced_redundancy?`

[Validate]