Starter

File Uploads

Accept file attachments with your form submissions

Static Forms allows users to upload files (documents, images, etc.) along with their form submissions. Uploaded files are attached to the notification email when one is sent and are persistently stored in private secure storage — downloadable from your Inbox at any time. File uploads are available from the Starter plan up.

Starter Feature

File uploads are available from the Starter plan up ($6/month, or $4/month billed annually) — 1 GB of storage on Starter, 5 GB on Pro, 10 GB on Agency. On the Free plan, forms cannot accept files at all. View pricing to enable this feature.

Suggested File Types (Client-Side)

The server does not enforce file type validation. Use the accept attribute and client-side checks to guide users. Common choices include:

Documents

  • PDF (.pdf)
  • Microsoft Word (.doc, .docx)
  • Text files (.txt)
  • Rich Text Format (.rtf)

Images

  • JPEG (.jpg, .jpeg)
  • PNG (.png)
  • GIF (.gif)
  • WebP (.webp)

File Size Limits

The limit applies to the whole submission, not to each file:

  • Maximum submission size: 4.5MB in total, counting every file plus the other form fields
  • Multiple files: all files share that limit, so two 3MB files are too large together
  • Recommended: keep the files under 4MB in total, which leaves room for the other fields

Submission Size

A submission over 4.5MB is rejected with HTTP 413 (Request Entity Too Large) before Static Forms processes it, so nothing is saved and no email is sent. A plain HTML form then shows a hosting error page instead of your redirectTo page, and a fetch call from your site sees only a network error. Compress large images or split large documents before uploading, and check the total size in the browser (see client-side validation below).

Implementation

To enable file uploads, you must add the enctype attribute to your form:

HTML

Complete Example

Here's a complete form example with file upload:

HTML

Multiple File Uploads

You can allow users to upload multiple files by adding the multiple attribute:

HTML

Multiple Files

When using multiple, all selected files count toward the same 4.5MB submission limit. All files will be attached to the notification email when one is sent.

File Input Attributes

Useful attributes for file input fields:

AttributeDescriptionExample
acceptRestricts file typesaccept=".pdf,.doc,.docx"
multipleAllows multiple filesmultiple
requiredMakes file upload requiredrequired
nameField name in submissionname="document"

AJAX File Uploads

When submitting files via AJAX, use FormData:

HTML

Important

When using FormData with fetch, do not set the Content-Type header. The browser will automatically set it to multipart/form-data with the correct boundary.

React Example

File uploads in React:

TypeScript

Error Handling

Common file upload errors and how to handle them:

Submission Too Large

Error: HTTP 413. What the visitor sees depends on how the form submits:

  • Plain HTML form: the browser shows a hosting error page on api.staticforms.dev, and your redirectTo page is not used.
  • fetch or AJAX from your site: the 413 has no CORS headers, so the browser reports a network error and your script can't read the status or body.
  • Server-side requests with Accept: application/json: the body is {"error": {"code": "413", "message": "Request Entity Too Large"}}. Without that header it is plain text or HTML.

Solution: Keep all files together under 4MB. Compress images, split large documents, or ask for fewer files per submission. In the browser, checking the total size before submitting is the only way to show a friendly message (see client-side validation). This response comes from the hosting layer, so it doesn't have the usual Static Forms error fields.

Client-Side File Type Check

Error: Your own client-side validation message

Solution: Use the accept attribute and JavaScript validation to restrict file types on the client side.

Missing enctype

Error: Files not being uploaded

Solution: Add enctype="multipart/form-data" to your form element.

Paid Plan Required

Error: File uploads require the Starter plan or above. Please upgrade your plan to enable file attachments.

Solution: File uploads are available from the Starter plan up ($6/month, or $4/month billed annually). Upgrade to Starter, Pro or Agency to enable them. View pricing

Best Practices

Always Use enctype

Never forget to add enctype="multipart/form-data" to forms with file uploads. Without it, files won't be sent.

Restrict File Types

Use the accept attribute to guide users and prevent invalid file types from being selected.

Show File Size Limit

Tell users the total size limit (4MB is a safe figure to show) so they know what to expect, and check the total in the browser before submission.

Validate on Client Side

Add JavaScript validation to check file size and type before submission for better user experience.

Client-Side File Validation

Add client-side validation to improve user experience:

HTML

Persistent File Storage

On Starter, Pro and Agency plans (including trials), uploaded files are stored privately in encrypted secure storage before the notification email goes out, when the form stores submissions and the submission is not held over your plan limit. If your quota cannot be freed or the storage write fails, that file is not stored and cannot be downloaded from your Inbox; it is still attached to the email when one is sent. You can download stored files from your Inbox at any time — no need to search your email archive.

Starter

  • 1 GB persistent storage
  • Files downloadable from Inbox
  • Private, encrypted cloud storage
  • Short-lived presigned download links

Pro

  • 5 GB persistent storage
  • Files downloadable from Inbox
  • Private, encrypted cloud storage
  • Short-lived presigned download links

Agency

  • 10 GB persistent storage (2× Pro)
  • Files downloadable from Inbox
  • Private, encrypted cloud storage
  • Short-lived presigned download links

Free plan

Free accounts cannot accept file uploads — submissions containing files are rejected with a 400. Move up to Starter ($6/month, or $4/month billed annually) for 1 GB of persistent storage and downloads from your Inbox.

Downloading Files from Inbox

To download an uploaded file from a past submission:

  1. Open Inbox from the sidebar
  2. Click the submission row to open its detail view
  3. Find the Attachments section in the detail view
  4. Click Download next to the file name

Presigned URLs

Each download click fetches a fresh 5-minute presigned URL. You must be signed in to your Static Forms account. The link is not shareable — it is generated on demand just for you.

Storage Quota & Auto-Eviction

When a new upload would exceed your storage quota, Static Forms automatically evicts the oldest stored files to make room. This keeps your account within quota without blocking new submissions.

  • Eviction removes the oldest files first (least-recently-uploaded)
  • Evicted files show as "evicted" in Inbox. Your notification email has the attachment if one went out with the file
  • You receive a one-time email warning at 80% quota usage
  • Storage usage is visible in Workspace → Plan & Usage

Prevent eviction

Monitor storage usage in Workspace → Plan & Usage. Delete old submissions you no longer need, or move up a plan — Starter (1 GB), Pro (5 GB), Agency (10 GB) — for more headroom.