Skip to main content

UploadPart

Uploads a part in a multipart upload.

note

In this operation, you provide new data as a part of an object in your request. However, you have an option to specify your existing Astran S3 object as a data source for the part you are uploading.

You must initiate a multipart upload (see CreateMultipartUpload) before you can upload any part. In response to your initiate request, Astran S3 returns an upload ID, a unique identifier that you must include in your upload part request.

Part numbers can be any number from 1 to 10,000, inclusive. A part number uniquely identifies a part and also defines its position within the object being created. If you upload a new part using the same part number that was used with a previous part, the previously uploaded part is overwritten.

For information about maximum and minimum part sizes and other multipart upload specifications, see Multipart upload limits in the Amazon S3 User Guide.

note

After you initiate multipart upload and upload one or more parts, you must either complete or abort multipart upload in order to stop getting charged for storage of the uploaded parts. Only after you either complete or abort multipart upload, Astran S3 frees up the parts storage and stops charging you for the parts storage.

For more information on multipart uploads, go to Multipart Upload Overview in the Amazon S3 User Guide .

Permissions

ActionDescriptionResource
PutObjectGrants permission to add an object to a bucketobject

Special errors

  • Error Code: NoSuchUpload
  • Description: The specified multipart upload does not exist. The upload ID might be invalid, or the multipart upload might have been aborted or completed.
  • HTTP Status Code: 404 Not Found

The following operations are related to UploadPart:

Request Syntax

PUT /Bucket/Key+?partNumber=PartNumber&uploadId=UploadId HTTP/1.1
Host: <partition>.s3.astran.io
Content-Length: ContentLength

Body

URI Request Parameters

The request uses the following URI parameters.

Bucket

The name of the bucket to which the multipart upload was initiated.

Required: Yes

Content-Length

Size of the body in bytes. This parameter is useful when the size of the body cannot be determined automatically.

Key

Object key for which the multipart upload was initiated.

Length Constraints: Minimum length of 1.

Required: Yes

partNumber

Part number of part being uploaded. This is a positive integer between 1 and 10,000.

Required: Yes

uploadId

Upload ID identifying the multipart upload whose part is being uploaded.

Required: Yes

Request Body

The request accepts the following binary data.

Body

Response Syntax

HTTP/1.1 200
ETag: ETag

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The response returns the following HTTP headers.

ETag

Entity tag for the uploaded object.

Examples

Sample Request for general purpose buckets

The following PUT request uploads a part (part number 1) in a multipart upload. The request includes the upload ID that you get in response to your Initiate Multipart Upload request.

PUT /bucket/my-movie.m2ts?partNumber=1&uploadId=VCVsb2FkIElEIGZvciBlbZZpbmcncyBteS1tb3ZpZS5tMnRzIHVwbG9hZR HTTP/1.1
Host: <partition>.s3.astran.io
Date: Mon, 1 Nov 2010 20:34:56 GMT
Content-Length: 10485760
Authorization: authorization string

***part data omitted***

Sample Response for general purpose buckets

The response includes the ETag header. You need to retain this value for use when you send the Complete Multipart Upload request.

HTTP/1.1 200 OK
x-request-id: 656c76696e6727732072657175657374
Date: Mon, 1 Nov 2010 20:34:56 GMT
ETag: "b54357faf0632cce46e942fa68356b38"
Content-Length: 0
Connection: keep-alive

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: