Multiparts file upload

Like single file upload, multiparts file upload is a 3 steps process:

Video File Upload

Video File Upload

1 - Initialize

Uploading large files requires splitting them to facilitate and speed up the upload process.

The upload needs to be initialized in multiple parts. The upload is done to a temporary secure repository.

You need to provide 2 informations for this upload initialization: the file name and its size (in bytes).

Example of POST content:

  "name": "filename.mp4",
  "size": "5500000"

You need to make a POST request with this information to the Multipart upload initialization endpoint.

Example of response:

  1. The API provides the following identifiers for the upload:
  • fileId: Upload identifier
  • fileKey: File identifier
  1. The chunkSize, which is the size of the parts to upload.
  2. The list of locations where the parts should be deposited, parts.

2 - Upload your file

The file parts need to be sent to the different signed URLs. The POST request for each part will return an Etag in the headers, which needs to be saved and associated with the partNumber.

Example of response headers:

HTTP/1.1 200 OK
x-amz-id-2: G7Pb1v1+QNQOmSvObizDgK95sRgXUkV3n1D8NG//DS7nDv389LFOLZMqqENJ3TVPRIpRHufXFuY=
x-amz-request-id: EZVXM83AQ3YBT6JN
Date: Mon, 12 Jun 2023 14:00:21 GMT
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, PUT, POST
Access-Control-Expose-Headers: ETag
Vary: Origin, Access-Control-Request-Headers, Access-Control-Request-Method
ETag: "e7c9741c3239200fd06d7bc0f8bc08a8"
x-amz-server-side-encryption: AES256
Server: AmazonS3
Content-Length: 0 

3 - Finalize

Once all the parts are sent, you need to notify 42videobricks (Multipart upload finalization) to reconstruct the file and trigger the video ingestion (transcoding) flow.

Example of POST content:

  "fileKey": "...",
  "fileId": "pathid\/filename.mp4",

The API will return true if everything goes well or false in case of an error.