Matterway
    Preparing search index...

    Function copyFile

    • Copies a file from one location to another within SharePoint.

      Parameters

      • client: Client

        The client instance used to make API requests.

      • options: {
            fileId: string;
            driveId: string;
            destinationFolderId: string;
            destinationDriveId: string;
            name: string;
        }

        The options for copying the file.

        • fileId: string

          The ID of the file to be copied.

        • driveId: string

          The ID of the drive containing the file to be copied.

        • destinationFolderId: string

          The ID of the destination folder where the file will be copied.

        • destinationDriveId: string

          The ID of the drive containing the destination folder.

        • name: string

          The name of the copied file.

      Returns Promise<void>

      A promise that resolves when the file has been copied.

      const client = await getSharePointClient(opt);
      const options = {
      fileId: 'file-id',
      driveId: 'drive-id',
      destinationFolderId: 'destination-folder-id',
      destinationDriveId: 'destination-drive-id',
      name: 'new-file-name',
      };
      await copyFile(client, options