Appearance
Function: deleteFile()
ts
function deleteFile(client: Client, options: {
driveId: string;
fileId: string;
}): Promise<void>;Defined in: src/ms-graph/sharepointGraph.ts:274
Delete a file from a SharePoint drive.
Parameters
| Parameter | Type | Description |
|---|---|---|
client | Client | The Microsoft Graph client instance. |
options | { driveId: string; fileId: string; } | The file location. |
options.driveId | string | The drive ID. |
options.fileId | string | The file ID. |
Returns
Promise<void>
A promise that resolves when the file is deleted.
Example
ts
const client = await getMsGraphClient(creds);
await deleteFile(client, { driveId: 'drive-id', fileId: 'obsolete-file-id' });
console.log('File deleted.');