Forum Discussion

Eric-H's avatar
Eric-H
Explorer | Level 3
9 years ago
Solved

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 ...
  • Greg-DB's avatar
    Greg-DB
    9 years ago
    Thanks 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.

About Dropbox API Support & Feedback

Node avatar for 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!