Appearance
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
| Parameter | Type | Description |
|---|---|---|
ctx | Context | The SDK context. |
token | string | Access token from getSharePointTokenUserAuth. |
options | { driveId: string; fileId: string; } | The drive and file identifiers. |
options.driveId | string | The drive ID. |
options.fileId | string | The 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');