Skip to content

Form field: get uploaded files

Plugin ID: eca_form_field_get_files

Available since: 3.1.9

Get the files uploaded into a file or image form field and store them as a token. Use the plain field name, for example field_pdf. The action resolves the file IDs from the widget input on its own, so neither a delta nor the widget internal fids key is required. On a single-value field the token holds the file entity, for example [my_files:fid], on a multi-value field it holds the list of file entities, for example [my_files:0:fid]. Nothing is stored when no file was uploaded.

Fields

Name of token — config key: token_name

The uploaded files will be loaded into this specified token. Example: when using my_files here, then [my_files:fid] holds the file ID on a single-value field, and [my_files:0:fid] holds the file ID of the first file on a multi-value field. Please provide the token name only, without brackets.

Type: textfield · Required: yes · Default: empty string

Field name — config key: field_name

The input name of the form field. This is mostly found in the "name" attribute of an <input> form element. For submit buttons within content forms: Use "submit" for the labeled "Save" button, and "preview" for the labeled "Preview" button. For values nested within a form element: Separate the nesting levels with a dot (or alternatively with a colon), for example "field_myfield.0.value" to address the value of the first item of a field widget.
This field supports tokens.

Type: textfield · Required: yes · Default: empty string