Skip to content

Function: getFileEval()

ts
function getFileEval(
   ctx: Context, 
   token: string, 
   options: {
  driveId: string;
  fileId: string;
}): Promise<ArrayBuffer>;

Defined in: src/ms-graph/sharepointGraphEval.ts:692

Get a file by its ID from a SharePoint drive via the Graph API (browser eval variant).

Parameters

ParameterTypeDescription
ctxContextThe SDK context.
tokenstringAccess token from getSharePointTokenUserAuth.
options{ driveId: string; fileId: string; }The drive and file identifiers.
options.driveIdstringThe drive ID.
options.fileIdstringThe file ID.

Returns

Promise<ArrayBuffer>

The file content as an ArrayBuffer.

Example

ts
const token = await getSharePointTokenUserAuth(ctx, authProps);
const content = await getFileEval(ctx, token, {
  driveId: 'drive-abc123',
  fileId: 'file-xyz789',
});
console.log('File size:', content.byteLength, 'bytes');

Matterway Assistant SDK Documentation