406 while downloading large size docx files in PDF format from sharepoint using GraphAPI with PHP

Copper Contributor

For smaller size files it is working fine but not for large size files (may be more than 4 MB) , 

We have tried this through Postman and getting below error ... which shows input file is too large.

I am not sure if we have any limit on the file size or how to solve it - Any help is greatly appriciated.

We have already  added setTimeout() with the request but no luck 


"error": {
"code": "notSupported",
"message": "Error from Office Service. Url=https://wordcs.officeapps.live.com/document/export/pdf HttpCode=UnsupportedMediaType cert=subject:;t...



Request format details:

Microsoft\Graph\Http\GraphRequest (13) (
protected 'accessToken' -> string (1570) "tokennnnnnnnnnnnn"
protected 'apiVersion' -> string (4) "v1.0"
protected 'baseUrl' -> string (28) "https://graph.microsoft.com/"
protected 'endpoint' -> string (134) "/drives/driveee/items/itemiddd/co...

'Content-Type' => string (16) "application/json"
'SdkVersion' => string ...

protected 'http_errors' -> boolean true
protected 'proxyPort' -> null
protected 'proxyVerifySSL' -> null
protected 'requestBody' -> null
protected 'requestType' -> string (3) "GET"
protected 'returnsStream' -> null
protected 'returnType' -> null
protected 'timeout' -> string (6) "1000"


Response from sharepoint : -----

HTTP/1.1 406 Not Acceptable
Cache-Control: private
Content-Length: 738
Content-Type: application/json; charset=utf-8
X-AspNetMvc-Version: 5.2
Access-Control-Expose-Headers: x-cache, x-msedge-ref, x-azure-ref-originshield
Server-Timing: Provider;dur=0,SharePoint;dur=57,StreamRead;dur=0,TotalRequest;dur=29900,Sandbox;dur=0
Request-Stat: Cached;False,RemoteReads;1
X-CorrelationId: f8f71b40-7752-42f0-b31c-0e3d684ff609.53af1cc2-0194-42e3-a733-57afe9d48d49
X-OneDriveMeTA-Build: Media_PROD_14299847_020422.1_02-04-2022
X-ErrorCode: OfficeConversion_ContentNotSupported
X-ErrorType: Expected
X-ErrorSource: Content
X-AspNet-Version: 4.0.30319
X-MSEdge-Ref: Ref A: 916B1515F1FD4AA08329A3BD644C6AEE Ref B: MAA01EDGE0708 Ref C: 2022-03-16T14:07:40Z
Date: Wed, 16 Mar 2022 14:08:10 GMT


0 Replies