Edit on GitHub
Jump to docs navigation

Field Types / File field

Note: You are currently reading the documentation for Bolt 4.0. Looking for the documentation for Bolt 3.7 instead?

Simple file upload/select field.

Basic Configuration:

        attachment:
            type: file

Example usage in templates:

{{ record.attachment }}

Options:

The field has a few options to change the appearance and functionality of the field.

  • extensions Allows you to restrict users to only be able to upload files with certain file extensions
  • upload Allows you to upload files for this field into a specified directory so they remain grouped. This directory will be created in {%web%}/files/
        attachment:
            type: file
            extensions: [ png, pdf ]
            upload: portfolio

Default value

When you want to give an file a default value, use default:. You can set the default value for an image like so:

        attachment:
            type: file
            default:
                filename: "example.pdf"
                title: "This is an example pdf file."


Edit this page on GitHub
Couldn't find what you were looking for? We are happy to help you in the forum, on Slack or on Github.