StrikekitStrikekit

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

QualifierRoleExample
toBasename beside the .stk (or under files/)api set file "main" to "invoice.pdf"

Requirements

ItemContract
Element / control shapeNone — HTTP session (Platform: api)
How the label bindsPath / body / headers are payloads ($ENV, slots expand)
Qualifiers that change resolveSee this command’s Qualifiers table
PlatformPlatform: api only — requires $API_BASE_URL (and auth env as needed)
Wrong shape → use insteadUI XHR wait → wait for response. Browser UI → web commands

See also UI contracts and Platform: api.

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}/filename then {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 file for binary uploads.
  • After a successful multipart send, the form queue (fields + files) is cleared.

On this page