Share via

Unable to send large attachment using graph api

Alfonso Camara 0 Reputation points
2023-04-04T12:06:02.5533333+00:00

Hello, I am getting error “invalid total bytes specified in the content-Range header”. While sending large attachments, the attachments <=3 MB works fine but for big attachment some times it doesn’t works.

Microsoft Security | Microsoft Graph
0 comments No comments

1 answer

Sort by: Most helpful
  1. HarmeetSingh7172 4,831 Reputation points
    2023-04-04T19:51:14.9866667+00:00

    Hello Alfonso Camara, Thanks for reaching out! From the error message it seems that the total bytes specified in the content-Range header is invalid. The Content-Range header has the following format:

    Content-Range: bytes <startindex>-<endindex>/<totallength>
    

    Your issue appears to be a mixing of indexes (0-based) and lengths (1-based). For a 100-byte file your header would need to look like:

    Content-Range: bytes 0-99/100
    

    Please check and validate if this issue still exists. Further reading on Attach Large Files Hope this helps. If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further questions about this answer, please click Comment.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.