Upload a File (Text or Binary)
litewrite_upload_fileUpload or overwrite files in a Litewrite project, including images, PDFs, and text, using a relative path.
Instructions
Upload a file to Litewrite, creating or overwriting it (POST /api/internal/files/upload).
Use for binary assets (images, PDFs) where edit/create are unsuitable, or as an alternative to create.
Args (provide exactly one source):
projectId (string, required): The project id.
filePath (string, required): Relative target path, e.g. "figures/logo.png".
content (string, optional): The text content to upload.
contentBase64 (string, optional): The raw file data base64-encoded.
overwrite (boolean, optional): Allow overwriting an existing file; default false.
Returns a confirmation.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | No | Text content to upload | |
| filePath | Yes | Relative target path | |
| overwrite | No | Overwrite an existing file (default false) | |
| projectId | Yes | The Litewrite project id | |
| contentBase64 | No | Raw file data, base64 encoded |