Flag of Ukraine

Handle uploads

The /upload/handle Robot receives uploads that your users throw at you from browser or apps, or that you throw at us programmatically.

Transloadit will handle file uploads for you whether you specify this Robot or not, so using it is optional.

It can still be good to define this Robot to make your Assembly Instructions explicit though, and to configure how exactly uploads should be handled. For example, what metadata we should extract for uploaded files?

There are three constraints when using this Robot. You must:

  • Not define a use parameter, contrary to all other Robots.
  • Only use it once in a single set of Assembly Instructions.
  • Name the Step that it's used in: :original.

For example:

{
  "steps": {
    ":original": {
      "robot": "/upload/handle",
      "output_meta": {
        "has_transparency": true
      }
    },
    "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.

    You can also set this to false to skip metadata extraction and speed up transcoding.

Related blog posts

Uppy
20% off any plan for the Uppy community
Use the UPPY20 code when upgrading.
Sign up
tus
20% off any plan for the tus community
Use the TUS20 code when upgrading.
Sign up
Product Hunt
20% off any plan for Product Hunters
Use the PRH20 code when upgrading.
Sign up