Actions71
- Asset Actions
- Attribute Actions
- Block Actions
- Database Actions
- Document Actions
- Markdown Table Actions
- Notebook Actions
- Search Actions
- System Actions
- Tag Actions
Asset → Put File
AI-generatedSummary
Create or overwrite a file or directory in the SiYuan workspace at the specified path.
Inputs
- filePath (required) — The path of the file or directory within the SiYuan workspace (must start with /).
- fileContent (required) — The content to write to the file (plain text string).
- putFileOptions.isDir — Whether to create a directory instead of a file (defaults to false).
Output shape
no body — success/failure only
The operation returns null on success and throws an error on failure.
Examples
Example 1: Create a text file
Set filePath to '/data/example.txt' and fileContent to 'Hello SiYuan'.
Example 2: Create a directory
Set filePath to '/data/my_folder', fileContent to any value, and putFileOptions.isDir to true.