Matterway
    Preparing search index...

    Function uploadFile

    • Uploads a file to a specified folder in a SharePoint drive.

      Parameters

      • client: Client

        The Microsoft Graph client instance.

      • options: {
            siteId: string;
            driveId: string;
            folderId: string;
            fileName: string;
            file: MwFile;
        }

        The options for the upload operation.

        • siteId: string

          The ID of the SharePoint site.

        • driveId: string

          The ID of the drive where the file will be uploaded.

        • folderId: string

          The ID of the folder where the file will be uploaded.

        • fileName: string

          The name of the file to be uploaded.

        • file: MwFile

      Returns Promise<void>

      A promise that resolves when the upload is complete.

      const client = await getSharePointClient(opt);
      const options = {
      siteId: 'your-site-id',
      driveId: 'your-drive-id',
      folderId: 'your-folder-id',
      fileName: 'your-file-name',
      file: MwFile,
      };
      await uploadFile(client, options