app:file:read

Retrieves file bytes without interpreting their format.

Options

NameTypeDescription
schemastringIs the database that contains the file record.
tablestringIs the table that contains the file record.
record_idstringIdentifies the record that owns the file.
fieldstringIs the file field to read.

Outputs

NameTypeDescription
filenamestring
content_typestring
content_base64string
encodingstring
sizeint64

Examples

name: Read a config file
actions:
  - name: config
    component: storage:local:file:read
    vars:
      path: ./config.json

outputs:
  config: "{{ config.body | from:'json' }}"
name: Read an uploaded file for document processing
actions:
  - name: source
    component: app:file:read
    vars:
      schema: content
      table: files
      record_id: "{{ var.file_id }}"
      field: source

  - name: selected
    component: data:document:select
    vars:
      format: xml
      content_base64: "{{ source.content_base64 }}"
      locator: /resources/string

outputs:
  filename: "{{ source.filename }}"
  entries: "{{ selected.matches }}"