[Microsoft Graph Connector] How to upload large file via MS Graph

Forge Component
(1)
Published on 2019-03-26 by Daniel Filipe
1 vote
Published on 2019-03-26 by Daniel Filipe

If upload file is larger than 4MB, it should make use of 'uploadsession'. Hence, I have tried to create upload session REST API like

"POST /drives/{driveId}/items/{itemId}/createUploadSession"

Then, i obtain the response 

{
  "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#microsoft.graph.uploadSession",
  "expirationDateTime": "2020-05-05T09:37:39.305Z",
  "nextExpectedRanges": [
    "0-"
  ],
  "uploadUrl": "https://xxx-my.sharepoint.com/personal/xx_yy/_api/v2.0/drives/b!ZA9jOhraNEyKmsCKkM2FPj8Q60_TvDlKsJPxboif87cpEElSBSwqT5ruGh7C7RCf/items/01XOXUBIJASN7PM6AUC5B2TB3QYTO4OS7E/uploadSession?guid='a5dee327-90b6-4128-b5c4-bd98b7c7702a'&path='~tmp7E_temp.txt'&overwrite=False&rename=True&dc=0&tempauth=eyJ0eXAiOiJKV1QiLCJhbGciOiJub25lIn0.eyJhdWQiOiIwMDAwMDAwMy0wMDAwLTBmZjEtY2UwMC0wMDAwMDAwMDAwMDAva2luZXRpeHN5c3RlbXMtbXkuc2hhcmVwb2ludC5jb21AZTIyNDE4NDctNDZlMC00OGJhLWFlM2UtMWU3ZGMzMDFkMTkyIi...."
}

After that, how can i upload bytes to this upload session link "uploadurl" ?

I have tried to upload by

PUT {uploadUrl}

Unfortunately, the failure result i got.

Please advise.