field.file

This component can be used for uploading files. It's displayed in the interface as an upload button.

You can list in the accept property the file types that will be suggested to the user when uploading. By default, only one file can be uploaded, but you can allow multiple files in the multiple property.

If a user logs in from a mobile device, it's more convenient to use field.media-file — it's adapted for mobile devices and makes it easier to upload photos and videos.

In the task review mode, the uploaded images will appear automatically. You can view, rotate, and switch among the images.

View example in the sandbox.

Component properties

NameTypeDescription
type*"field.file"

Set component type

data*writable

Data with values that will be processed or changed.

labelstring

Label above the component.

acceptarray

A list of file types that will be suggested to the user when uploading. By default, you can upload any files.

Specify the types in the MIME Type format. For example, you can suggest uploading images by adding the image/jpeg and image/png types.

accept[]string

File type in the MIME Type format.

hintstring

Hint text.

multipleboolean

Determines whether multiple files can be uploaded:

  • false (default) — forbidden.
  • true — allowed.
validationcondition

Validation based on condition.

NameTypeDescription
type*"field.file"

Set component type

data*writable

Data with values that will be processed or changed.

labelstring

Label above the component.

acceptarray

A list of file types that will be suggested to the user when uploading. By default, you can upload any files.

Specify the types in the MIME Type format. For example, you can suggest uploading images by adding the image/jpeg and image/png types.

accept[]string

File type in the MIME Type format.

hintstring

Hint text.

multipleboolean

Determines whether multiple files can be uploaded:

  • false (default) — forbidden.
  • true — allowed.
validationcondition

Validation based on condition.