You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
le h.
9 years agoNew member | Level 1
How to download a file which I want to use processbar for that?
I want to use processbar, folderpicker for downloading.
This code just download. It not support for processbar, folderpicker.... and show a message if finished downloading.
public async void Down...
Greg-DB
9 years agoDropbox Staff
Actually, for reference, you can track progress if you use GetContentAsStreamAsync. E.g., you can do something like:
var response = await client.Files.DownloadAsync(path);
ulong fileSize = response.Response.Size;
const int bufferSize = 1024 * 1024;
var buffer = new byte[bufferSize];
using (var stream = await response.GetContentAsStreamAsync())
{
using (var file = new FileStream("Test", FileMode.OpenOrCreate))
{
var length = stream.Read(buffer, 0, bufferSize);
while (length > 0)
{
file.Write(buffer, 0, length);
var percentage = 100 * (ulong)file.Length / fileSize;
// Update progress bar with the percentage.
// progressBar.Value = (int)percentage
Console.WriteLine(percentage);
length = stream.Read(buffer, 0, bufferSize);
}
}
}
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,910 PostsLatest Activity: 3 days agoIf you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!