Appearance
Function: moveFile()
ts
function moveFile(client: Client, options: {
fileId: string;
driveId: string;
destinationFolderId: string;
destinationDriveId: string;
}): Promise<void>;Defined in: src/ms-graph/sharepointGraph.ts:359
Move a file to another location in SharePoint.
Parameters
| Parameter | Type | Description |
|---|---|---|
client | Client | The Microsoft Graph client instance. |
options | { fileId: string; driveId: string; destinationFolderId: string; destinationDriveId: string; } | The move options. |
options.fileId | string | The file ID to move. |
options.driveId | string | The source drive ID. |
options.destinationFolderId | string | The destination folder ID. |
options.destinationDriveId | string | The destination drive ID. |
Returns
Promise<void>
A promise that resolves when the move completes.
Example
ts
const client = await getMsGraphClient(creds);
await moveFile(client, {
fileId: 'file-id',
driveId: 'source-drive',
destinationFolderId: 'completed-folder',
destinationDriveId: 'archive-drive',
});