fs_write_binary
Write binary files to your project from Base64 data with atomic replacement and SHA-256 validation. Enforces size limits and supports safe creation or update of files.
Instructions
Write a binary file under the project root from plain Base64 (not a data URL; no remote fetch). Requires lease_id. Line breaks and the URL-safe alphabet are accepted; padding is optional. Decoded size capped at 2_000_000 bytes (coupled with Caddy 4MB body limit). For existing files, expected_sha256 is mandatory (use sha256 from fs_read UNSUPPORTED_BINARY); CONFLICT if the file changed. create=true allows new files (empty expected_sha256). Atomic temp+fsync+replace. Same write gates as fs_apply_patch.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| create | No | ||
| project | No | demo | |
| lease_id | Yes | ||
| content_base64 | Yes | ||
| expected_sha256 | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||