upload_file_to_project
Initiates storing an original project file byte-for-byte by returning an upload URL and form details; POST the file to that URL, then register its s3_key to record it in the project.
Instructions
Step 1 of storing an original file (template deck, sheet, doc, image) in a project, kept byte for byte so it can be downloaded and edited later. For searchable text, the KB tools fit instead.
Returns {uploadUrl, uploadDetails, s3_key, upload_requires}. The upload completes with a
multipart/form-data POST of the file to `uploadUrl`: every property of `uploadDetails` as a form
field, then the file itself under the field `file` as the LAST field (S3 ignores fields after
`file`); a 201 response means success. register_project_file(s3_key) then records the file.
Example (curl):
curl -X POST "<uploadUrl>" \
-F key="<uploadDetails.key>" -F Policy="<uploadDetails.Policy>" \
-F X-Amz-Algorithm="..." -F X-Amz-Credential="..." -F X-Amz-Date="..." \
-F X-Amz-Signature="..." -F Content-Type="<uploadDetails.Content-Type>" \
-F success_action_status="201" \
-F file=@/path/to/your/file.pptx
(every field present in uploadDetails, with -F file=@... last.)
Allowed: pptx/ppt/xlsx/xls/docx/doc/pdf/csv/md/txt/json/png/jpg/gif/svg/webp (max 256MB).
The POST needs outbound HTTPS access to Amazon S3. In an environment without it, the POST fails
before reaching S3 (e.g. "CONNECT tunnel failed", "Could not resolve host", HTTP 000 or a proxy
403), and a retry fails the same way; create_upload_link gives the user a browser page for the
same upload, or the file can be uploaded in the Unilytics app.Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | ||
| byte_size | No | ||
| project_id | Yes | ||
| content_type | No |