SaveFile(filePath, data, [schema], [ensurePath]) Last updated: 22. Nov 2023
API only function
Saves a file to Docly document according to specified schema. Overwrites if it already exists.
Parameters
Name | Type | Description |
---|---|---|
filePath | string | Absolute path to where you want to save data. |
data | object | Data to store, will be converted to JSON and stored. |
schema (optional) | string | Absolute path to your Docly schema to store the file as. Required for new files, for updating existing file it is not required. |
ensurePath (optional) | bool | If true the folder path will be created if it is missing. Default is false. |
Returns
An object with references to the saved file with:
- timestamp
- guid
- filename
* Filename may be needed if autogenerated filenames are used.
Example
Code example (#JS)
#JS is mixed HTML (or other text file) with inline JavaScript with # starting and ending each inline statement.Demo not available
For more info see:
https://developers.docly.net/JavaScript-examples/Data/Save-data-to-Docly-from-API-function