api set file
Queue a multipart file part on the Platform api session
Queue one multipart file part (field name + basename). Repeat for multiple files. Send with a bare api post / put / patch.
Syntax
When I api set file "<field>" to "<filename>"Qualifiers
| Qualifier | Role | Example |
|---|---|---|
to | Basename beside the .stk (or under files/) | api set file "main" to "invoice.pdf" |
Examples
When I api set fields to '{"name":"Invoice","folder":"docs"}'
When I api set file "main" to "invoice.pdf"
When I api set file "extra" to "receipt.pdf"
When I api post "/upload"
Then I api should status "201"Notes
- File lookup matches upload /
with body file:{stk-dir}/filenamethen{stk-dir}/files/filename. - Same field name replaces the previous file for that part.
- This is multipart form-data, not raw JSON body. Do not use
with body filefor binary uploads. - After a successful multipart send, the form queue (fields + files) is cleared.