Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,075 of 9,075 pages
About the help in other languages
All help pages

File attachments in forms

How visitors can attach a file to a form in Exponential with the Enhanced File datatype of enhancedezbinaryfile, its storage limit and mail behavior, the risks of accepting files from the public, and when to use a…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/government/building/forms/file-attachments-in-forms.md

On this page

File attachments in forms

This page is for website creators and administrators who need visitors to attach a file to a form, for example a photo of a damaged road sign or a supporting document. The kernel's File datatype (ezbinaryfile) is for editors; for information collection Exponential uses the Enhanced File datatype of the enhancedezbinaryfile extension (enhancedezbinaryfile). Accepting files from anyone on the internet is a risk; read the whole page before switching it on.

Note This page describes features and common practice; it is not legal advice. Check the law that applies to your organization with your legal counsel.

Contents

  1. What the datatype does
  2. Setting it up
  3. Risks and measures
  4. When to use another system

What the datatype does

BehaviorDetail
Upload in a collector attributeshown as Enhanced File in the class editor
Storage with a limitmodule.ini [RemoveFiles] MaxFiles=25: only that many uploaded files are kept; DownloadPath=original/attachments
Mailthe collected information is mailed as a multi-part mail with the file attached, when there is an attachment
Failed mailfiles are stored below var/<siteaccess>/storage/original/collected/<filetype>
Template checkthe filecheck operator tests whether a file still exists before linking it

MaxFiles=0 keeps an unlimited number of files, which the extension's own documentation advises against for sites with anonymous uploads. The default installation activates the extension (Extensions it activates).

Setting it up

  1. In the form class (Setup > Classes), add an attribute of the datatype Enhanced File, tick Information collector, and decide whether it is required.
  2. Set the limits in settings/override/module.ini.append.php ([RemoveFiles] MaxFiles), and the PHP upload limit (upload_max_filesize) on the server. Disk space needed is at most MaxFiles times upload_max_filesize.
  3. Make sure the form template posts with enctype="multipart/form-data".
  4. Test: send a file logged out, check the mail with the attachment (file transport first, Mail to receivers) and the stored file.

Risks and measures

RiskMeasure
Malware in uploaded filesscan files on the server (an antivirus on the storage path or the mail gateway); never open attachments on unprotected workstations
Files used to store or distribute illegal contentkeep MaxFiles small; files are not public, they are kept in storage and mailed; check that the download path is not served by the web server
Personal data in documents (IDs, medical letters)ask only for what you need; say so on the form; remove files once processed
Very large filesPHP and web server upload limits
Spam with attachmentsform tokens, moderation, a CAPTCHA after assessment (Spam protection and third parties)
Mail size limitsthe receiving mail server may refuse large attachments; test with the largest allowed file

Exponential sanitizes SVG uploads and refuses dangerous file names such as shell.php.jpg in the editor's upload (Content model and editing, Security standards); it does not scan files for malware.

When to use another system

SituationUse
Applications with several required documentsthe case or application system
Documents with special categories of personal dataa system approved for that data
Many uploads a daya system with scanning, quotas and case handling
Uploads that must be kept as recordsa records or case system, not mail boxes

For most public forms, asking people to describe the problem and offering a separate route for documents is safer than accepting uploads.

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x