Appearance
Function: copyFileEval()
ts
function copyFileEval(
ctx: Context,
token: string,
options: {
driveId: string;
parentId: string;
fileId: string;
newFileName: string;
}): Promise<boolean>;Defined in: src/ms-graph/sharepointGraphEval.ts:839
Copy a file in 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; parentId: string; fileId: string; newFileName: string; } | The copy options. |
options.driveId | string | The drive ID containing the file. |
options.parentId | string | The destination parent folder ID. |
options.fileId | string | The source file ID. |
options.newFileName | string | The name for the copied file. |
Returns
Promise<boolean>
True if the copy succeeded.
Example
ts
const token = await getSharePointTokenUserAuth(ctx, authProps);
const copied = await copyFileEval(ctx, token, {
driveId: 'drive-abc123',
parentId: 'archive-folder-id',
fileId: 'original-file-id',
newFileName: 'budget-backup.xlsx',
});
console.log('Copied:', copied);