Using File Upload Fields

File Upload Field in the CMS

When editing a form in the CMS, you can add a field of type File Upload. Configure the following options in the field settings:

  • Maximum file size: Set the maximum allowed file size in megabytes (MB). This value restricts the size of uploaded files. Note that your servlet container (for example, Tomcat) may also enforce its own file size limits.
  • File extensions: Specify a comma-separated list of allowed file extensions. Leave this field empty to allow all file types.

File Upload Handling on the Site

The default JSP template for forms automatically sets the correct method and encoding type for file uploads:

<form method="post" enctype="multipart/form-data"> ... </form>

To process file uploads in your HST component that uses (Configurable)MailFormDataBehavior, configure the following properties:

PropertyValueNotes
fileuploadEnabledtrueEnables file upload processing in the component.
fileuploadMethodfilesystem or emailSelect filesystem to save files to disk, or email to attach files to outgoing email.
fileuploadDirectory/path/to/directoryRequired if fileuploadMethod is filesystem. Defaults to /tmp/hippo.
Share Feedback
Page: /build/enterprise-plugins/enterprise-forms/using-file-uploads
Section: Build
Category *