dropbox-sdk-dotnet icon indicating copy to clipboard operation
dropbox-sdk-dotnet copied to clipboard

Uploading Files with Progress

Open oranaise2412 opened this issue 9 years ago • 11 comments

First things first, thx a million for this api its really good i got downloading with progress to work but i m still stuck at reporting progress when uploading files. I saw your ChunckUpload method and added this here to it var percentage = 100 * ((chunkSize * idx) / (double)stream.Length); int pValue = (int)Math.Ceiling((decimal)percentage); this.progressBar1.BeginInvoke((MethodInvoker)delegate() { progressBar1.Value = pValue; }); well the progressbar moves to 80 and stops there after the file is already uploaded.If you dont mind please add a small method or correct my code so all can enjoy your great api :)

oranaise2412 avatar Jul 21 '16 20:07 oranaise2412

@oranaise2412 It's hard to say what the problem may be here without seeing the rest of the code, but it sounds like the your code here to update the progress bar just isn't getting called when the final chunked upload call is made.

That is, maybe you're only calling this when UploadSessionAppend is called, but not when UploadSessionFinish is called? The final call to UploadSessionFinish can contain the last piece of data.

In any case, we'll consider this a feature request for easier progress listeners in the SDK.

greg-db avatar Jul 21 '16 21:07 greg-db

Thx for that quick reply ! Mind showing me a sample of uploading files with progressbar ?

oranaise2412 avatar Jul 22 '16 19:07 oranaise2412

I don't have an example like that to share unfortunately. Exactly how you connect it to your app's UI will depend on your app anyway, of course.

greg-db avatar Jul 22 '16 20:07 greg-db

Well i m building a Dropbox manager in winforms i was quite happy when downloading with progress worked so i thought about uploading with progress, but could not get further with my code

oranaise2412 avatar Jul 22 '16 20:07 oranaise2412

Well i tryed this code from rajib https://www.dropboxforum.com/hc/en-us/community/posts/206986286-How-to-get-Progress-Status-while-uploading-downloading-a-file-in-Net- maybe it points you to the right direction :P ?

oranaise2412 avatar Jul 22 '16 20:07 oranaise2412

Any progress in this issue ?

facebookegypt avatar Apr 22 '20 22:04 facebookegypt

@facebookegypt No, unfortunately the Dropbox .NET SDK still doesn't offer native progress listeners, so you'd need to implement progress reporting in between chunks when uploading via upload sessions as discussed above.

greg-db avatar Apr 23 '20 13:04 greg-db

Hi, I have taken your direction in progress reporting based around chunks. It works okay albeit a little bit clunky. It will do for now. I do have one question though about your comment "no native listeners"... does that also mean there is no actual way to report the speed of the upload or download using the SDK? I can open another issue, but I felt it was related to this one hence me asking here.

IamSierraCharlie avatar Apr 25 '20 13:04 IamSierraCharlie

@IamSierraCharlie That's correct, while you can track progress by chunks as you mentioned, my earlier comment is referring to the fact that the Dropbox .NET SDK does not currently offer a way to track the progress of an upload during any single upload request (such as over the course of the upload of a single chunk). We'll add your feedback to this feature request. Thanks!

greg-db avatar Apr 27 '20 15:04 greg-db

@greg-db Native progress listener : You mean to track progress in the DropBox side, right? Because, I'm able to track ChunkUpload Progress in a desktop Project using VB .Net.

facebookegypt avatar May 01 '20 17:05 facebookegypt

@facebookegypt Yes, the feature request is for functionality that would be provided by the Dropbox SDK to inform your code of how much progress has been made in the upload to Dropbox, during the individual request.

greg-db avatar May 01 '20 17:05 greg-db