sdk.file_2.filetodrive
Home > @matterway/sdk > File_2 > fileToDrive
File_2.fileToDrive() function
Writes a file to the local drive.
Signature:
export declare function fileToDrive(file: SdkFile, path: string): Promise<void>;
Parameters
Parameter | Type | Description |
---|---|---|
file | SdkFile | The SdkFile object containing the data to write. |
path | string | The path of the file to write. |
Returns:
Promise<void>
Promise of void
Example
const file = { name: 'example.txt', data: 'SGVsbG8gV29ybGQh', type: 'text/plain' }; const path = 'documents/'; await fileToDrive(file, path);