Upload to OneDrive returning 504 Gateway Timeout (

2019-08-26 06:01发布

问题:

I am trying to upload new file to the OneDrive using Microsoft.GrapApi after that modify it. Frequenlty I am getting the error 504 Gateway Timeout (Unknown error ) during upload modified file.

Here you can find sample of azure function which frequenlty throws 504 Gateway Timeout (Unknown error ) error. In order to get the error you need to call azure function end-point many times by using script from repo.

回答1:

This is probably due to the size of the file you are trying to upload, according to Microsoft Graph the limit for "simple" uploads is 4MB, you will have to create an upload session, chunk the file in bytes and send them in multiple requests.