You may write text content into a file using file/write :
svc=file/write¶ms={"itemId":<long>, "storageType":<uint>, "path":<text> "content":<text>, "writeType":<uint>, "contentType":<uint>}
Params
| Parameter | Description |
|---|---|
| itemId | item id |
| storageType | storage type: 1Â – public (all users may see/download files ), 2Â – protected (that users may see/down- load files who being grant rights) |
| path | relative path from root folder to the file included |
| content | content being written |
| writeType | write type: 0Â – rewrite a file, 1Â – append to a file, 2Â – do not rewrite if the file exists |
| contentType | content type; the content is returned as: 0Â – text, 1Â – hex string, 2Â – base64 string |
Response
After write success:
{}
Errors
{ "error":<uint> /* error code */ }
| Error code | Description |
|---|---|
| 1 | you are not authorized |
| 3 | file not found |
| 4 | wrong id inputted (not digits) |
| 5 | file already exists (if ‘do not rewrite existed file’ option chosen) |
| 7 | ‘id’ not found |