We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
Eric-H
9 years agoExplorer | Level 3
How To Tell File Being Uploaded From Progress Block
Is there any way to know what file is being worked on when the progress block is called? See the working code below - I'd like to be able to put an update on the screen so that the user knows which ...
- 9 years agoThanks for following up Eric. I'm not sure if I understand your concern exactly though. It looks like the technique I described should work in your case.
Your updateFileStatusPercent method takes the place of progressCallback in my sample above. You can add an extra parameter to updateFileStatusPercent to identify the specific file, like how I have the identifier parameter in my sample.
For example, your identifier may be your NSString* file. The progress block is defined separately for each file, that is, for each iteration of your loop, so the identifier will be different each time. The subsequent calls to updateFileStatusPercent will then contain the distinct identifiers.
Greg-DB
Dropbox Community Moderator
9 years agoThanks for following up Eric. I'm not sure if I understand your concern exactly though. It looks like the technique I described should work in your case.
Your updateFileStatusPercent method takes the place of progressCallback in my sample above. You can add an extra parameter to updateFileStatusPercent to identify the specific file, like how I have the identifier parameter in my sample.
For example, your identifier may be your NSString* file. The progress block is defined separately for each file, that is, for each iteration of your loop, so the identifier will be different each time. The subsequent calls to updateFileStatusPercent will then contain the distinct identifiers.
Your updateFileStatusPercent method takes the place of progressCallback in my sample above. You can add an extra parameter to updateFileStatusPercent to identify the specific file, like how I have the identifier parameter in my sample.
For example, your identifier may be your NSString* file. The progress block is defined separately for each file, that is, for each iteration of your loop, so the identifier will be different each time. The subsequent calls to updateFileStatusPercent will then contain the distinct identifiers.
Eric-H
9 years agoExplorer | Level 3
Apologies - I was being dense. I forgot that I had access to the file variable in the setProgress block. I'm good now.
Many thanks!
Eric
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!