Datei schreiben
Inhalt in eine Datei im Webspace-Home schreiben. Übergeordnete Verzeichnisse werden erstellt. Max. 10 MB.
Inhalt in eine Datei im Webspace-Home schreiben. Übergeordnete Verzeichnisse werden erstellt. Max. 10 MB.
Erforderlicher Scope: webspace:manage
| Header | Erforderlich | Wert |
|---|---|---|
Authorization |
Ja | Bearer DEIN_API_SCHLÜSSEL |
Content-Type |
Ja | application/json |
| Parameter | Erforderlich | Beschreibung |
|---|---|---|
path |
Ja | Absoluter Pfad innerhalb ~/. |
content |
Ja | Dateiinhalt (String). |
encoding |
Nein | utf8 (Standard) oder base64. |
{ "data": { "path": "/home/ws_0862c/public_html/index.html", "size": 256 } }
| Status | Code | Beschreibung |
|---|---|---|
| 400 | MISSING_CONTENT |
content fehlt oder ist kein String. |
| 413 | CONTENT_TOO_LARGE |
Inhalt überschreitet 10 MB. |
curl -X PUT https://hosting.site.quest/api/v1/webspaces/69e80ac1.../sftp/write \
-H "Authorization: Bearer sq_live_..." \
-H "Content-Type: application/json" \
-d '{ "path": "/home/ws_0862c/public_html/hello.txt", "content": "Hello World!" }'
Diese Aktion ist auch über das webspace_write_file MCP-Tool verfügbar.