XML API multipart uploads (original) (raw)

This page discusses XML API multipart uploads in Cloud Storage. This upload method uploads files in parts and then assembles them into a single object using a final request. XML API multipart uploads are compatible with Amazon S3 multipart uploads.

Overview

An XML API multipart upload lets you upload data in multiple parts and then assemble them into a final object. This behavior has several advantages, particularly for large files:

An XML API multipart upload has three required steps:

  1. Initiate the upload using a POST request, which includes specifying any metadata that the completed object should have. The response returns anUploadId that you use in all subsequent requests associated with the upload.
  2. Upload the data using one or more PUT requests.
  3. Complete the upload using a POST request. This request overwrites any existing object in the bucket with the same name.

There is no limit to how long a multipart upload and its uploaded parts can remain unfinished or idle in a bucket.

Considerations

The following limitations apply to using XML API multipart uploads:

Keep in mind the following when working with XML API multipart uploads:

How client libraries use XML API multipart uploads

This section provides information about performing XML API multipart uploads with client libraries that support it.

Client libraries

Java

For more information, see theCloud Storage Java API reference documentation.

To authenticate to Cloud Storage, set up Application Default Credentials. For more information, seeSet up authentication for client libraries.

The Java client library does not support XML API multipart uploads. Instead, useparallel composite uploads.

Node.js

For more information, see theCloud Storage Node.js API reference documentation.

To authenticate to Cloud Storage, set up Application Default Credentials. For more information, seeSet up authentication for client libraries.

You can perform XML API multipart uploads using theuploadFileInChunks method. For example:

Python

For more information, see theCloud Storage Python API reference documentation.

To authenticate to Cloud Storage, set up Application Default Credentials. For more information, seeSet up authentication for client libraries.

You can perform XML API multipart uploads using theupload_chunks_concurrently method. For example:

What's next