Function uploadFileEval

  • Upload a file to a SharePoint drive using Microsoft Graph API.

    Parameters

    • ctx: Context
    • token: string

      Access token from getSharePointTokenUserAuth

    • options: {
          arrayBuffer: ArrayBuffer;
          driveId: string;
          filePath: string;
      }
      • arrayBuffer: ArrayBuffer

        File content as ArrayBuffer

      • driveId: string

        Drive ID (e.g. , 'ab!5xqiQKeGnEGeI02fc4Mu5HrH_BkaM1FNnCohEqq7eEnQYz1prATORbPSv-3951Ny')

      • filePath: string

        File path (e.g. , '/path/to/file.txt')

    Returns Promise<any>

    Return upload response

    const uploadResponse = await uploadFileEval(ctx, token, {
    driveId: 'ab!5xqiQKeGnEGeI02fc4Mu5HrH_BkaM1FNnCohEqq7eEnQYz1prATORbPSv-3951Ny',
    filePath: '/path/to/file.txt',
    arrayBuffer: fileArrayBuffer,
    });