dropbox-sdk-dotnet
dropbox-sdk-dotnet copied to clipboard
Uploading Files with Progress
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 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.
Thx for that quick reply ! Mind showing me a sample of uploading files with progressbar ?
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.
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
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 ?
Any progress in this issue ?
@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.
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 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 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 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.