Search code examples
httponedrive

OneDrive huge streaming upload


I'd like to upload a stream of unknown length larger then 100 MBytes to OneDrive. The API endpoint I use is Resumable item upload. My question now is if there is a possibility to set the Content-Range header to a value which enables the transfer of a stream with unknown size.

As RFC7233 states in section 4.2 Content-Range: bytes 42-1233/* would state that the total length is unknown, but unfortunately that fails with a HTTP 400 with the body{"error":{"code":"invalidRequest","message":"Invalid Content-Range header value"}}.


Solution

  • Unfortunately, when uploading via chunks OneDrive must know the expected length in order to intelligently commit the upload when it is complete. If you feel that being able to upload an unknown amount of data feel free to submit an idea at our uservoice site - be sure to outline your scenario.