Data Types

Multipart File Uploads

Multipart file uploads increase network throughput by uploading multiple parts of your file in parallel.

The benefits of multipart file uploads are:

  • Higher file upload rate (1000 req/sec by default)

  • Larger files (up to 5TB for enterprise customers)

  • Parallel upload requests for a single file

  • Only failed parts of the file need to be re-uploaded on network failure (not the entire file)

The Bytescale API supports multipart file uploads, in addition to single part uploads:

The Upload Widget and Bytescale SDKs have multipart file uploads built in.

To implement multipart file uploads manually, for example, to use a programming language that Bytescale doesn't provide an SDK for:

  1. Calculate the file's size.

  2. Call begin multipart upload, passing the file's name, size, and type.

  3. Open the file for reading.

  4. Read the correct section of the file. (This is the section specified by the inclusiveStart andinclusiveEnd fields from the HTTP response from step 2 or step 10.)

  5. Make an HTTP PUT request, using the data from step 4 as the request body, and the uploadUrl from the HTTP response from step 2 (or step 10) as the URL.

    • Request must include the Content-Length header.

    • Request must not include the Transfer-Encoding: Chunked header.

  6. Read the etag HTTP response header from step 5.

  7. Call complete upload part, passing the etag, uploadId, and uploadPartIndex.

  8. If uploadPartIndex = uploadParts.count - 1, then exit (the upload is complete), else continue:

  9. Call get upload part, passing an incremented uploadPartIndex.

  10. Repeat from step 4, using the new uploadPartIndex, uploadUrl, inclusiveStart, and inclusiveEnd returned by step 10.

Was this section helpful? Yes No

You are using an outdated browser.

This website requires a modern web browser -- the latest versions of these browsers are supported: