Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
RAJIB N.
10 years agoNew member | Level 1
How to get Progress Status while uploading/ downloading a file ( in .Net ) ?
I am using DropboxClient.Files.UploadAsync method for uploading file and
DropboxClient.Files.DownloadAsync for downloading.
Uploading and Downloading works perfectly but can't get the progress s...
Greg-DB
Dropbox Community Moderator
10 years agoHere's a sample of uploading using upload sessions:
private async Task ChunkUpload(String path, FileStream stream, int chunkSize)
{
int numChunks = (int)Math.Ceiling((double)stream.Length / chunkSize);
byte[] buffer = new byte[chunkSize];
string sessionId = null;
for (var idx = 0; idx < numChunks; idx++)
{
var byteRead = stream.Read(buffer, 0, chunkSize);
using (var memSream = new MemoryStream(buffer, 0, byteRead))
{
if (idx == 0)
{
var result = await this.client.Files.UploadSessionStartAsync(memSream);
sessionId = result.SessionId;
}
else
{
var cursor = new UploadSessionCursor(sessionId, (ulong)(chunkSize * idx));
if (idx == numChunks - 1)
{
await this.client.Files.UploadSessionFinishAsync(cursor, new CommitInfo(path), memSream);
}
else
{
await this.client.Files.UploadSessionAppendAsync(cursor, memSream);
}
}
}
}
}
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If 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, Facebook or Instagram.
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!