*upload
*upload turns an element into a file-upload trigger. It creates a hidden file input, lets the user pick files, and sends them with XMLHttpRequest and FormData.
*keysselects accompanying host data.*paramsadds request metadata.*dry-runmarks the upload request as dry-run.*responsemaps the parsed response into host data.
<button
type="button"
*upload="'/api/avatar'"
accept="image/*"
*keys="profile"
*params="{ kind: 'avatar' }"
*response="'result'">
Upload avatar
</button>
Files are always sent as multipart/form-data. Sercrod also appends JSON fields named sercrod, data, and params.
Every successful response is mirrored to $response. Without *response, normal host data is not changed. *into remains a compatibility alias for whole-response placement.