Search code examples
c#dropboxdropbox-apirestsharp

c# Dropbox RestSharp download part of file


I have an 'ASP.NET' console application, i use the 'RestSharp' client for Dropbox. I need to download part of file from Dropbox (fro example i need to read from 0 byte to 10000 byte) and should not download all file.

I need to send the bytes in request and not get the whole file or save the whole file in local storage or in memory.


Solution

  • /files (GET) in Dropbox API v1 supports HTTP range retrieval requests, so for your example, you can just add the header Range: bytes=0-10001 to your API call.

    (I believe that API v2 support for range retrieval is planned but not yet implemented.)