Search code examples
office365onedrive

OneDrive for Office365, partial content requests?


Working my way through the OneDrive for Office365 REST api materials and so far so good, however I've run into an issue and not sure if this is by design, or something I'm not doing properly..

I have a file I would like to download, however application requirements dictate I must pull it down in small chunks. As such I am trying to use the HTTP Range header to direct OneDrive for Office365 to provide just the requested subset of the file.

GET /api/v1.0/me/files/<FILEID>/content
User-Agent: xyz
Authorization: Bearer ...
Range: bytes=0-100

However, regardless of what I try I always get back the entire file. Is it not possible to perform range requests for file reads?

Thanks!


Solution

  • Thanks for your question. Unfortunately, it is currently not possible to perform range requests for file reads. It only works for OneDrive (Consumer) -- see Chunk download with OneDrive Rest API, which is exactly what you described. However this does not yet work on OneDrive for Business.