File Attachment
Description
With the File Attachment feature, users can easily attach files to their forms. This component can be customized to allow multiple files and specify the maximum size of each file. Additionally, it supports a range of file formats that are compatible with adaptive forms.
To ensure that recipients only receive relevant files, AEM authors have the option to restrict the types of files that can be attached. By default, audio, video, image, plain text, and PDF files are accepted. However, authors can easily adjust the settings to allow for Microsoft Office files as well.
Please keep in mind that if you are using a form connected to a Sharepoint list, it is important to retain the name field as "Attachments".
- SharePoint Online: The maximum size for a single attached file is 250 MB, and the combined total size of all attachments on a single list item cannot exceed 250 MB.
- Email: If the form submission is configured to be sent via email, the total combined file size for all attachments is limited to 10 MB via enterprise-wide Outlook policy.
Configuration
Select the component and click the wrench icon on the component toolbar to configure the properties for File Attachment.
The following list is all that you need to configure to set up the File Attachment button.
- Name: When using a SharePoint List, it is required to set the value as "Attachments" (case sensitive).
- Title: This label is used above the attachment button.
- Hide Title: Check this box if you only want to show the button and its label on this field.
- Upload Button Title: This field assigns the button text.
- Allow Multiple Files (Checkbox): Check the box to allow multiple attachments
- Maximum File Size: Set the file size limit in MB to prevent people from uploading oversized files.
- Supported File Types: This is where you can choose which file types users can attach.
Authoring
File Attachment Limitations & Best Practices
While AEM allows for a large default file upload size (2GB), other systems involved in the form submission process have stricter limits. It's crucial for authors to be aware of these limitations to prevent form submission errors and provide a better user experience.
- SharePoint Online: The maximum size for a single attached file is 250 MB, and the combined total size of all attachments on a single list item cannot exceed 250 MB.
- Email: If the form submission is configured to be sent via email, the total combined file size for all attachments is limited to 10 MB via enterprise-wide Outlook policy.
To proactively manage these limitations, it is a best practice to set the "Maximum File Size" property on the File Attachment component configuration. This ensures that users receive an immediate error message if they attempt to upload a file that exceeds the allowed size, thereby preventing a failed form submission later in the process. When setting this limit, authors should always choose the most restrictive limit that applies to your form's submission process (e.g., if the form is sent via email, set the limit to 10 MB).
Filename & Format Restrictions
In addition to size constraints, AEM adaptive forms have specific requirements for how files are named. Files with a filename starting with the characters (.), are not supported. Furthermore, filenames cannot contain the following special characters: [ ] \ / : * ? " < > | ; % $. Authors must also ensure users do not attempt to upload files with names reserved by the Windows operating system, such as nul, prn, con, lpt, or com, as these will cause the submission to fail. Including these reminders in the component's help text is a best practice to ensure a successful user journey.
Configuring Help Content
To prevent users from encountering errors only after they've attempted an upload, authors should include a brief instruction in the Short Description of the Help Content section of the component. This text should clearly state the allowed file formats, size limits, and naming restrictions. Below are templates you can copy and paste directly into your component; be sure to update the bracketed text with the specific file types (e.g., PDF, Word, JPG) you have permitted in the component settings:
- For Email Submissions: Supported file types: [Insert allowed types, e.g., PDF, Word, and Images]. Maximum combined attachment size (singular or combind) is 10 MB. Please ensure filenames do not start with the characters (.), containing characters []\ / : * ? " < > | ; % $, or containing special filenames reserved for Windows operating system like nul, prn, con, lpt, or com are not supported.
- For SharePoint Submissions: Supported file types: [Insert allowed types, e.g., PDF, Word, and Images]. Maximum combined attachment size is 250 MB. Please ensure filenames do not start with the characters (.), containing characters []\ / : * ? " < > | ; % $, or containing special filenames reserved for Windows operating system like nul, prn, con, lpt, or com are not supported.
Removing Unwanted File Type
Click on the Wrench > Click on the Garbage Can icon next to the file type that should be prohibited.
Allowing Microsoft Office Files
Click on the Wrench > Change the "applications/pdf" into "applications/*" located under the side panel section.