Step 1 — Request a presigned URL
Note: The exactfieldsvary depending on your AWS signature version and credential type. When using temporary credentials (SSO/STS), anx-amz-security-tokenfield is also included. Always iterate over all returned fields dynamically rather than hardcoding field names.
Step 2 — Upload file to S3
Build aFormData from the fields object, append the file last, and POST directly to the S3 url. This bypasses your backend entirely.
Step 3 — Confirm the upload
KnowledgeDocument database record.
Supported file types
| Extension | Content Type |
|---|---|
application/pdf | |
| DOCX | application/vnd.openxmlformats-officedocument.wordprocessingml.document |
| XLSX | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet |
| PNG | image/png |
| JPG/JPEG | image/jpeg |
Limits
- Maximum file size: 25 MB (enforced by S3 policy and server-side verification)
- Presigned URL expiry: 15 minutes