I'm using Dropbox .net api DropboxClient.Files.DownloadAsync() to download files from my Dropbox account. The API document says it supports file range spec, meaning I can download the first 1000 bytes of a file instead of the whole file, but I couldn't find how to set the range. Can anybody help? Thanks a lot.
Sample code here:
HttpClient httpClient = new HttpClient(new WebRequestHandler { ReadWriteTimeout = 10 * 1000 })
{
// Specify request level timeout which decides maximum time that can be spent on
// download/upload files.
Timeout = TimeSpan.FromMinutes(20)
};
var config = new DropboxClientConfig("myDropboxApp")
{
HttpClient = httpClient
};
downloadAgent = new DropboxClient(AccessToken, config);
using (var response = await downloadAgent .Files.DownloadAsync(folder + "/" + file))
{
fileSize = response.Response.Size;
const int bufferSize = 1024 * 1024;
...
}