Home > SYS_FileSystem > saveFileToFileSystem
SYS_FileSystem.saveFileToFileSystem() method
This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
Write a file to the file system
Signature
function saveFileToFileSystem(
uri: string,
fileData: File | Blob,
fileName?: string,
force?: boolean,
): Promise<boolean>;2
3
4
5
6
Parameters
Parameter | Type | Description |
|---|---|---|
uri | string | File resource locator. If it ends with a slash |
fileData | File | Blob | File data |
fileName | string | (Optional) File name |
force | boolean | (Optional) Force write (overwrite the file if it exists) |
Returns
Promise<boolean>
Whether the write operation was successful. If overwriting is not allowed but the file already exists, false is returned
Remarks
Note 1: This API is only valid for clients. Calling it in a browser environment will always throw Error
Note 2: This API requires the user to enable the extension external interaction permission, if not enabled, it will always throw Error