The /file/decompress Robot

Our /file/decompress robot

Transloadit can both archive and extract entire media libraries.

The /file/decompress Robot Extracts entire archives of files to be consumed by other Robots or exported as individual files.

The /file/decompress Robot's Parameters

Name Type Default Description
ignore_errors Boolean false There might be an error coming up when trying to extract meta data from the files inside your archive. This happens for files that are zero bytes big for example. Setting this to true will cause the Robot to not stop the file decompression (and the entire Assembly) when that happens.

Example use cases featuring the /file/decompress robot

See the robot in action with some live demos and code samples right here on our website:

Extract all images from an archive and resize them

Here you can see a quick example of the Assembly Instructions required to create this encoding pipeline. More information is available in the Live demo

{
 "steps": {
    "extract": {
      "use": ":original",
      "robot": "/file/decompress"
    },
    "resize": {
      "robot": "/image/resize",
      "use": "extract",
      "result": true,
      "width": 200,
      "height": 200,
      "resize_strategy": "pad"
    }
  }
}

Automatically extract all files from an archive

Here you can see a quick example of the Assembly Instructions required to create this encoding pipeline. More information is available in the Live demo

{
 "steps": {
    "extract": {
      "use": ":original",
      "robot": "/file/decompress",
      "result": true
    }
  }
}

Automatically extract uploaded archives

Here you can see a quick example of the Assembly Instructions required to create this encoding pipeline. More information is available in the Live demo

{
 "steps": {
    "archives": {
      "use": ":original",
      "robot": "/file/filter",
      "accepts": [
        [
          "${file.mime}",
          "regex",
          "application/(rar|x-7z-compressed|x-cab|x-cpio|x-debian-package|x-gtar-compressed|x-gzip|x-lzh|x-redhat-package-manager|x-tar|zip)"
        ]
      ],
      "error_on_decline": false
    },
    "non-archives": {
      "use": ":original",
      "robot": "/file/filter",
      "declines": [
        [
          "${file.mime}",
          "regex",
          "application/(rar|x-7z-compressed|x-cab|x-cpio|x-debian-package|x-gtar-compressed|x-gzip|x-lzh|x-redhat-package-manager|x-tar|zip)"
        ]
      ],
      "error_on_decline": false
    },
    "extracted": {
      "use": "archives",
      "robot": "/file/decompress"
    },
    "encoded-ipad": {
      "use": [
        "non-archives",
        "extracted"
      ],
      "robot": "/video/encode",
      "preset": "ipad-high",
      "result": true
    },
    "encoded-webm": {
      "use": [
        "non-archives",
        "extracted"
      ],
      "robot": "/video/encode",
      "preset": "webm",
      "result": true
    },
    "exported": {
      "use": [
        ":original",
        "encoded-ipad",
        "encoded-webm"
      ],
      "robot": "/s3/store",
      "key": "YOUR_AWS_KEY",
      "secret": "YOUR_AWS_SECRET",
      "bucket": "YOUR_S3_BUCKET"
    }
  }
}


Did you know?

You can easily combine Robots to create powerful workflows, unique to your business.

This is the power of Transloadit.