reply with file

This block is part of the files group and was last modified in core v12.1.1.

reply with file v12.1.1

reply to http connection with a file

In pins 4 + flow
  • flow
    flow
  • connection required
    httpconnection
  • code required
    number

    HTTP Status Code to return on this response.

  • Headers
    array<object>

    Custom HTTP Headers to set, Array of Objects [{ key: Value, value: Value }]

  • file required
    file

    A blueprint file-type to be returned on this connection.

Out pins 1 + flow
  • flow
    flow
  • connection
    httpconnection

Replies with a file streamed from disk: the first entry of the file pin supplies path, content type and download filename, overriding the deprecated filepath pin; the root pin restricts lookup to a subdirectory of the entity root. Content-Type defaults to application/octet-stream and the status code is only applied when the code pin is above 0. Flushes immediately mid-flow; an unwired or nil connection sends nothing and outputs nil.

A typical wiring for reply with file: branch feeds the flow pin; current request feeds the connection pin; number feeds the code pin; get file from assets feeds the file pin; the flow out pin feeds debug.

Studio canvas example for the reply with file block: typical wiring for reply with file.

Commonly used with

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

  • branch: feeds into this block.
  • current request: feeds into this block. Retrieves a reference to the current HTTP Connection.
  • number: feeds into this block. Generates a valid number from the filled custom value in the blueprint.
  • get fields: feeds into this block. Gets the selected fields from the given object.

Used in these guides

These documentation pages use or explain this block:

Version history

Introduced in v12.1.1.


Back to files Return to the main group to view all sub-groups Back to response Return to the group to view all blocks within this group