Upload a file
upload_assetUpload an image or file to a Wiki.js asset folder as base64 so it can be embedded in pages. Blocks SVG, HTML, and XML to prevent script execution.
Instructions
Uploads an image or file to an asset folder, so it can be embedded in a page. Content is passed base64-encoded and the content type is derived from the extension. SVG, HTML and XML are refused: Wiki.js serves assets from the wiki’s own origin, so those can carry script that runs for every reader. Note that Wiki.js 2.x has no GraphQL mutation for uploads at all — this uses the editor’s own route, which is undocumented and could change in a future Wiki.js release.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | File name including its extension, e.g. "diagram.png". | |
| folder_id | No | Target folder id. 0 (default) is the root. | |
| content_base64 | Yes | File contents, base64-encoded. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| truncated | No | Present only when the answer was shortened to fit the budget. |