Onedrive file size limit?

Re: Onedrive file size limit?

by Rob Davenport -
Number of replies: 0
Hi Simon,

We have been testing the OneDrive Repo recently and have found the exact same issue (and confirmed with Microsoft) when using "Access Controlled Links". Our host provided this explanation, we may be going back to them soon to see if any development work is possible to solve, as Microsoft themselves don't appear too interested in supporting any of their own plugins for Moodle:

______________________________________________________ SNIP________
The error you have noticed is directly caused by uploading a sizeable file and the curl (data transfer protocol) process exceeds the php execution timeout default of 30 seconds. The particular logic of this is detailed here https://docs.microsoft.com/en-us/graph/api/driveitem-createuploadsession?view=graph-rest-1.0, but the relevant detail states: 

Upload bytes to the upload session

To upload the file, or a portion of the file, your app makes a PUT request to the uploadUrl value received in the createUploadSession response. You can upload the entire file, or split the file into multiple byte ranges, as long as the maximum bytes in any given request is less than 60 MiB.


The fragments of the file must be uploaded sequentially in order. Uploading fragments out of order will result in an error.


Note: If your app splits a file into multiple byte ranges, the size of each byte range MUST be a multiple of 320 KiB (327,680 bytes). Using a fragment size that does not divide evenly by 320 KiB will result in errors committing some files.



Large files are liable to not meet these requirements. Previous efforts with another client to bump the default time window up also did not work because you cannot increase the php timeout on various location/functions and have it take any effect that matters with this kind of problem. The support tech that worked that case also mentioned this: 

The Curl call request is made from the lib/filelib.php script ("function request") and the script encounters the php execution timeout before the Curl request can send a response back... The response is then interpreted as empty hence the exception error    


In other words,  the large amount of data being sent is timing out before the destination can send back receipt confirmation of said data.

This appears to be a somewhat unavoidable issue when uploading large data files via this method to OneDrive.
____________________________________END SNIP____________________

Hope that helps. Cheers, Rob.