Attachment
The Single Attachment
and Attachment List
components allow your users to upload files to your Budibase app.
Uploaded files are stored in MinIO.
The Single Attachment
and Attachment List
components works especially well with Single attachment and Attachment List Budibase DB's Attachment data type.
Filesize
Remember the maximum file size you can store in your database of choice
Adding an Attachment component
The Attachment component
requires a Form component as a parent.
To add the Attachment component, click Form > Single Attachment
or Form > Attachment List
.

After the Single Attachment
or Attachment List
component is added you can immediately start using it, no further configuration is required.

Manage access
If you want to specify user roles such as allowing public file uploads, then you'll need to adjust the write access levels of your table.
Validation
There are few Form validation options for the attachment field.
Constraint | Description |
---|---|
Required | At least one file must be uploaded. |
Max file size (MB) | No uploaded file can exceed the specified limit in megabytes. |
Max total upload size (MB) | The total size of all uploaded files cannot exceed the specified megabytes limit. |

Specifying acceptable file extensions
By default any file, with any file extension, will be accepted by the Attachment component for upload. However, in certain scenarios, a particular set of file extensions may preferred. For example, you may only want to accept PDF files. In other situations, you may only want image files.
The extensions property accepts an array of file extensions, e.g. [".webp",".png"]
. When Using Handlebars , make sure to split the comma separated array. If Using JavaScript, simply return an array of extensions as shown below.
{{ split ".png,.jpg,.jpeg,.svg,.gif,.webp" }}
return ['.png','.jpg','.jpeg','.svg','.gif','.webp']
This will result in the operating system's native File Open Dialog having a corresponding custom filter:

Customised file extensions filter in the Attachment component
Updated 15 days ago