Handle uploads
🤖/upload/handle receives uploads that your users throw at you from browser or apps, or that you throw at us programmatically.
Transloadit handles file uploads by default, so specifying this Robot is optional.
It can still be a good idea to define this Robot, though. It makes your Assembly Instructions explicit, and allows you to configure exactly how uploads should be handled. For example, you can extract specific metadata from the uploaded files.
There are 3 important constraints when using this Robot:
- Don’t define a
use
parameter, unlike with other Robots. - Use it only once in a single set of Assembly Instructions.
- Name the Step as
:original
.
Usage example
Handle uploads and export the uploaded files to S3:
{
"steps": {
":original": {
"robot": "/upload/handle"
},
"exported": {
"robot": "/s3/store",
"use": ":original",
"credentials": "YOUR_S3_CREDENTIALS"
}
}
}
Parameters
-
output_meta
Object / Boolean ⋅ default:{}
Allows you to specify a set of metadata that is more expensive on CPU power to calculate, and thus is disabled by default to keep your Assemblies processing fast.
For images, you can add
"has_transparency": true
in this object to extract if the image contains transparent parts and"dominant_colors": true
to extract an array of hexadecimal color codes from the image.For videos, you can add the
"colorspace: true"
parameter to extract the colorspace of the output video.For audio, you can add
"mean_volume": true
to get a single value representing the mean average volume of the audio file.You can also set this to
false
to skip metadata extraction and speed up transcoding.
Related blog posts
- Implementing drag and drop file upload in React September 17, 2024
- New pricing model for future Transloadit customers February 7, 2018
- Easily burn subtitles into videos with our new Robot December 6, 2018
- Tutorial: file filtering & virus scanning with Transloadit February 6, 2019
- Re-Loadit: simplify uploads with /upload/handle Robot February 13, 2019
- How to insert watermarks to videos with Transloadit February 20, 2019
- Exploring the /google/store Robot in Re-Loadit series March 1, 2019
- Exploring the 'output_meta' parameter in Transloadit March 20, 2019
- Tutorial: using /video/merge to develop video slideshows June 14, 2019
- No-code real-time video uploading with Bubble & Transloadit August 2, 2019
- New feature: auto-transcribe videos with subtitles March 8, 2021
- Introducing the OCR Robot for easy text extraction August 26, 2021
- Let's Build: video from album art with Transloadit October 10, 2021
- Why Transloadit outperforms S3 for file uploads April 6, 2023