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.
id | -> | upload_id |
id | [R] | @return [String] Returns the upload id. |
object | [R] | @return [S3Object] Returns the object this upload is intended for. |
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]
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.
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.
@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}.
@return [UploadedPartCollection] A collection representing
the parts that have been uploaded to S3 for this upload.