The /file/filter robot

« Back to File Filtering
Our /file/filter robot
tagline: is a gatekeeper that can direct files to different encoding steps based on your conditions
more:

Name Type Default Description

use

(required) String or Array

The previous step

General
Specifies which step(s) to use as the input to this robot. By default, the previous Step defined above the current one will be used.

Special Step names
A special Step name is ":original", which "uses" the originally uploaded files.

Providing several Steps as input
You can also add arrays here to use several steps:
use: [ ":original", "encode2", "resizing3" ]

Demo
See a demo for the use parameter here.

accepts

Array

[]

Files that match at least one requirement will be accepted, or declined otherwise. Example:
[['${file.mime}', '=', 'image/gif']].
If the condition_type parameter is set to "and ", then all requirements must match for the file to be accepted.

declines

Array

[]

Files that match at least one requirement will be declined, or accepted otherwise. Example:
[['${file.size}','>','1024']].
If the condition_type parameter is set to "and ", then all requirements must match for the file to be declined.

condition_type

String

"or"

Specifies the condition type according to which the members of the accepts or declines arrays should be evaluated. Can be "or" or "and".

error_on_decline

Boolean

false

If this is set to true and one or more files are declined, the Assembly will be stopped and marked with an error.

error_msg

String

"One of your files was declined"

This is the error message shown to your users (such as by the jQuery SDK) when a file is declined and error_on_decline is set to true.

» See full docs on the /file/filter robot

Example use cases featuring the /file/filter robot

Blog posts about the /file/filter robot

FAQs about the /file/filter robot

Did you know?

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

This is the power of Transloadit.