To upload a file to our API, you must meet the following criteria:
We strive to support a variety of methods to upload files to MediaLab to ensure each use case can pick their best option. The following methods are currently supported:
TUS resumable uploads protocol is a standardized way to upload files to a server. It allows you to upload files in chunks and resume the upload later. The protocol is described here and has plenty of open source clients available to implement. The full workflow to upload files using TUS is as follows:
The API supports regular form-based POST uploads. This can be used to upload a file from a script or let users upload directly with a file input / uploader from your own website.
This upload flow only requires your API authorization to register a new upload and to mark it as finished afterwards. The file uploads will be executed to a signed URL returned from our API when registering the upload id.
If you are planning to let your users upload to our API directly without exposing your API credentials, please ensure to set the "hide_response" flag to indicate the uploader should not receive any confidential information.The full workflow to upload files using HTTP POST is as follows:
There are multiple config settings that can be passed to the upload/id method:
curl -X POST https://example.medialab.app/upload/id \
-F 'folder_id=101' \
-H 'Authorization: [Bearer|Private-Token] [TOKEN_GOES_HERE]'
{
'ulid': 'string',
'expires': 'int',
'expires_in': 'int',
'url_upload_direct': 'string',
'api': {
'rel': 'string',
'upload': 'string',
'finish': 'string'
}
}
curl -X POST https://upload.medialab.app/upload/file \
-F 'file=@MyFile.mp4' \
-F 'folder_id=101' \
-F 'title=Video.mp4'
If the customer has chosen to use S3 as their storage backend, you can upload directly to S3 with a singlepart of multipart upload. Our API provides endpoints to sign your S3 uploads. This can only be done if the target folder has S3 storage configured or if a global storage container is configured for all folders.
If you prefer to upload directly to S3 in a different way, you can upload it to S3 yourself and then call our endpoint POST /api/upload/blob to add the object.
It's also possible to register an SQS queue to automatically make new objects available in MediaLab without the need to manually call the API. Contact our service desk for more information.
Since we utilize a hybrid cloud infrastructure, it is always necessary to register an upload first and use the provided upload URL. This is because the upload URL will point to a different domain than the tenant's API domain and may change over time. It is therefore not possible to upload a file using a single call, the upload ID is a required first step.
If you are utilizing MediaLab as API back-end for your website, you can integrate a direct upload to MediaLab from your website. If you are looking to quickly upload files from Linux servers or NAS devices, it's also possible to use simple Bash scripts. here on GitHub.