sdk.file_2.filefromdrive
Home > @matterway/sdk > File_2 > fileFromDrive
File_2.fileFromDrive() function
Reads a file from the file system and returns an SdkFile
object that contains the file data and metadata.
Signature:
export declare function fileFromDrive(path: string, type: string): SdkFile;
Parameters
Parameter | Type | Description |
---|---|---|
path | string | The path to the file on the file system. |
type | string | The MIME type of the file. |
Returns:
An SdkFile
object that contains the file data and metadata.
Example
const filePath = '/path/to/file.txt'; const fileType = 'text/plain'; const file = fileFromDrive(filePath, fileType); // Now you can use the file
object as needed.