Create upload
CreateUploadSession
Creates a new upload session.
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
The access control mode of the file being uploaded. It's useful when the session signed URL is shared with the client, so the client won't be able to download the file after it's uploaded.
ACCESS_CONTROL_MODE_UNSPECIFIED
, ACCESS_CONTROL_MODE_PUBLICREAD
, ACCESS_CONTROL_MODE_SIGNEDREAD
The content type of the file being uploaded. For example, "image/png".
The name of the object to create the upload session for. It's recommended to use the name of the file being uploaded.
The ID of the project to create the upload session for. It must be a valid project ID. The final destination of the file will be determined by the project's region.
The region to create the upload session for. It's recommended to use the region closest to the who will be reading the file. The final destination of the file will be determined by the project's region and will be stored in the region specified here.
REGION_UNSPECIFIED
, REGION_AF
, REGION_AS
, REGION_EU
, REGION_NA
, REGION_OC
, REGION_SA
The size of the file being uploaded. It's useful when the session signed URL is shared with the client, so the client won't be able to upload a file larger than the size specified here.
The duration of the upload session. The upload session will expire after this duration. It's recommended to keep this duration as short as possible and no longer than 24 hours. It's useful when the session signed URL is shared with the client.
Whether the upload session is resumable. If set to true, the client can resume the upload session if it's interrupted. It's useful when the client is uploading a large file and the upload session is interrupted.
Response
The signed URL to upload the file to.
The client should use this URL to upload the file via PUT
request.
Content-Type
header should be set to the value specified when creating
the upload session. The being uploaded Content-Length
should be equal or
less than the size specified when creating the upload session.
The client should use Blob
or Binary
payload type for the request body and
only send the file content. For example, formData is not supported because it
will add additional metadata to the request body and increase the size of the
request body which will cause the upload to fail because the size of the
body will be larger than the size specified when creating the upload session.
Chunked uploads are supported for large files.
Provides information about the upload session.