on api file upload

This block is part of the http connection group and was last modified in core v15.0.0.

on api file upload v15.0.0

Exposes URI on /api/. Accepts a multipart/form-data POST request and saves the attached file. Supports its own rate limit and lock (serialisation) through the pins below.

In pins 7
  • file size limit
    number

    the file size limit in bytes

    Default 5242880 bytes (5MB)

  • rate limit v15.0.0
    number

    Maximum number of uploads allowed per timeframe. Leave empty for the cluster default. Must be a fixed value on this block.

  • rate limit timeframe v15.0.0
    number

    Length of the rate-limit window in seconds.

    Default 60

  • rate limit per v15.0.0
    value

    What the limit is counted per: url, url_user, method_url or method_url_user. • Suggestions: url url_user method_url method_url_user

    Default method_url_user

  • lock v15.0.0
    condition

    Serialise this endpoint: while one upload is running, another caller with the same lock key waits (or gets a 429 when the timeout is 0).

    Default false

  • lock timeout v15.0.0
    number

    How many seconds a waiting caller may queue for the lock before it gets a 429. 0 fails immediately. Clamped to 30.

    Default 0

  • lock per v15.0.0
    value

    What the lock is claimed per: url, url_user, method_url or method_url_user. • Suggestions: url url_user method_url method_url_user

    Default method_url_user

Out pins 1
  • On Request
    execute_function
register file

A typical wiring for on api file upload: number feeds the filesize pin; x feeds the rate_limit pin; the function out pin wires to an execute block.

Studio canvas example for the on api file upload block: typical wiring for on api file upload.

Commonly used with

In production blueprints, this block is most often wired together with:

  • execute: this block feeds into it. Executes the given funcion and waits for it to be executed.
  • number: feeds into this block. Generates a valid number from the filled custom value in the blueprint.
  • x: feeds into this block. Multiplication operator produces the product of the operands.

Version history

Introduced in v15.0.0.


Back to http connection Return to the main group to view all sub-groups Back to api Return to the group to view all blocks within this group