Updated March 2026
Add a field with type "file" to your form definition. Sutrena handles the upload flow, storage, and access control.
Two optional properties: accept specifies allowed file types (".pdf,.doc,image/*") and maxFileSize sets the limit in bytes (up to 50MB / 52428800 bytes). Both are enforced server-side.
On hosted forms, the upload is automatic. The UI renders a file input with the right accept attribute, validates size client-side for quick feedback, and handles the upload transparently. User picks a file, fills in other fields, hits submit.
For custom frontends using Sutrena headlessly, file uploads use a presigned URL flow. Your frontend requests a presigned upload URL, uploads the file directly to storage, then includes the file reference in the submission payload. Large files skip your server entirely.
When reading submissions with files, GET /api/forms/{id}/submissions returns file metadata (name, size, type) and a URL for access. Files are only accessible through authenticated API calls -- not publicly exposed.
File fields work with all other Sutrena features. Webhooks get file metadata. Dashboards show files in data tables. CSV exports include file URLs.
50MB per file covers most use cases: PDFs, images, documents. For larger files, use a dedicated storage service and submit just the URL through a text field.
# Create a form with a file upload field
curl -X POST https://sutrena.com/api/forms \
-H "Authorization: Bearer st_live_your_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Application Form",
"fields": [
{ "name": "name", "label": "Full Name", "type": "text", "required": true },
{ "name": "email", "label": "Email", "type": "email", "required": true },
{ "name": "resume", "label": "Resume", "type": "file", "required": true, "accept": ".pdf,.doc,.docx", "maxFileSize": 10485760 }
]
}'