I was looking at the code and found the download link. If I remove /content
from the URL, I get a JSON object that contains the file size of the ZIP file. I was thinking it's possible to parse the JSON, grab the download size, and then show in the UI.
Note this is not the same as the drive size, since the drive may be expandable up to 64GB (but not necessarily taking up that amount of space on the computer).
I'm always struggling for disk space, so knowing the download size is super helpful. Below is an example of the "Windows 10.utm.zip" VM url:
{
...
...
"lastModifiedDateTime": "2022-03-25T11:39:04.91Z",
"name": "Windows 10.utm.zip",
"parentReference": {
"driveId": "6046fc9e3521e28d",
"driveType": "personal"
},
"size": 5556485106, // file size. I assume this is 5.5 GB
"webUrl": "https://1drv.ms/u/s!Ao3iITWe_EZgptIbtpDA_-Vi86RaNg",
"file": {
"hashes": {
"quickXorHash": "5LcKRAD//gDMG2F6lyJJy9e7FCI=",
"sha1Hash": "9B97DC4D6114B7D1B00685E3AE2AC4B5F18FE3D7",
"sha256Hash": "913AA67F5D7C842CB36E2D7C962E8281A8AB1384E712684E07A6E9ACDD740009"
},
"mimeType": "application/zip"
},
...
...
}