Skip to content

Function: fileFromDrive()

ts
function fileFromDrive(filepath: string, type: string): Promise<SdkFile>;

Defined in: src/file/getFile.tsx:183

Parameters

ParameterTypeDescription
filepathstring-
typestringThe MIME type of the file.

Returns

Promise<SdkFile>

An SdkFile object that contains the file data and metadata.

Deprecated

Reads a file from the file system and returns an SdkFile object that contains the file data and metadata.

Example

ts
const filePath = '/path/to/file.txt';
const fileType = 'text/plain';
const file = fileFromDrive(filePath, fileType);
// Now you can use the `file` object as needed.

Matterway Assistant SDK Documentation