I'm downloading (video) file attachments using the OneNote REST API with PHP and cURL. While all goes smoothly with files < 30.0 MB, anything larger produces a 502 Bad Gateway error and no data.
Whereas, in a different situation (shared notebook) with a 502 error the addition of "FavorDataRecency: true" to the API request solved the problem, in this situation it has no effect.
What's the way around (or through) this problem?
[EDIT]
It is a timeout problem (thanks Jim). My logs show that file downloads halt with the 502 error exactly at 120 seconds.
My PHP script is running on localhost under IIS 10 on Windows 10. I thought I was onto something when I found the connection timeout for IIS was 120 seconds. But I've upped it to 240 seconds and the timeout barrier is still there.
Other config changes I've made:
- Upped the FastCgi requestTimeout and activityTimeout in IIS 10.
- Added a CURLOPT_TIMEOUT of 240 secs (as well as the CURLOPT_CONNECTTIMEOUT of 240 secs already set).
Is there some other timeout setting I'm missing?
Any chance it could be a timeout on the OneNote servers?