File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -64,6 +64,34 @@ The returned file will contain either `text_content` or `binary_content_b64`.
6464Provide either ` text_content ` for text files or ` binary_content_b64 ` for
6565binary data. The response will include whichever field was supplied.
6666
67+ #### Add Binary Files
68+
69+ To upload binary assets (for example, images or compiled artifacts) encode the
70+ file contents as Base64 and provide them via the ` binary_content_b64 ` field.
71+
72+ ``` http
73+ POST /files/upsert
74+ Content-Type: application/json
75+
76+ {
77+ "file_path": "assets/logo.png",
78+ "binary_content_b64": "iVBORw0KGgoAAAANSUhEUgAA..."
79+ }
80+
81+ Response: {
82+ "file": {
83+ "file_id": "42",
84+ "file_path": "assets/logo.png",
85+ "binary_content_b64": "iVBORw0KGgoAAAANSUhEUgAA...",
86+ "created_at": "2024-01-01T00:00:00.000Z"
87+ }
88+ }
89+ ```
90+
91+ The server persists the binary payload exactly as provided. When retrieving the
92+ file with ` /files/get ` , the same ` binary_content_b64 ` string will be returned
93+ and can be decoded back to the original bytes in your client code.
94+
6795#### Get File
6896
6997``` http
You can’t perform that action at this time.
0 commit comments