Our /upload/handle Robot

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:

  1. Don’t define a use parameter, unlike with other Robots.
  2. Use it only once in a single set of Assembly Instructions.
  3. 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