Skip to content

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

ParameterTypeDescription
clientClientThe Microsoft Graph client instance.
options{ fileId: string; driveId: string; destinationFolderId: string; destinationDriveId: string; }The move options.
options.fileIdstringThe file ID to move.
options.driveIdstringThe source drive ID.
options.destinationFolderIdstringThe destination folder ID.
options.destinationDriveIdstringThe 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',
});

Matterway Assistant SDK Documentation