question

pratikjaiswal-4874 avatar image
0 Votes"
pratikjaiswal-4874 asked pratikjaiswal-4874 commented

Is it possible to upload a file to One Drive if I don't know its size ahead of time?

Our application will frequently have the need to upload a stream of bytes for a file to One Drive, and we won't know the size of the file ahead of time. I am aware of the documentation for One Drive here that clearly indicates it is not possible, but I am really hoping if there's a way to work around this.

Important: Your app must ensure the total file size specified in the Content-Range header is the same for all requests. If a byte range declares a different file size, the request will fail.

Or is there any work being done to enhance the REST API so we can do this? Google Drive uses a very similar method for uploading large files, but supports unknown file sizes by doing this with the Content-Range header during chunk transfer 0-127/* and then on the final chunk we can specify the known size 128-255/256.

I'm just really surprised this is not supported.





office-onedrive-client-itpro
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

emizhang-msft avatar image
0 Votes"
emizhang-msft answered pratikjaiswal-4874 commented

Hi @pratikjaiswal-4874,
Based on your description, I suggest you try to post this issue to OneDrive for Developer forum:

https://techcommunity.microsoft.com/t5/onedrive-developer/bd-p/OneDriveDeveloper

And you can also give a feedback about it to OneDrive UserVoice forum, this is a way for Microsoft collect feedback from users:

https://onedrive.uservoice.com/

The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.


If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.




· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.