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 file is being uploaded. I know that it could be uploading several files synchronously - so this is why I'd like to know which one it is referring to each time the progress block is called.
[[[dbClient.filesRoutes uploadUrl:remoteFile inputUrl:[NSURL fileURLWithPath:localFile]] setResponseBlock:^(DBFILESFileMetadata *metadata, DBFILESUploadError *uploadError, DBRequestError *error)
{
if (metadata)
{
NSLog(@The upload completed successfully.);
NSLog(@File metadata:);
NSLog(@%@", metadata);
} else if (uploadError)
{
NSLog(@Something went wrong with the upload:);
NSLog(@%@", uploadError);
} else if (error)
{
NSLog(@Something went wrong with the API call:);
NSLog(@%@", error);
}
++self.filesUploaded;
[[NSNotificationCenter defaultCenter] postNotificationName:NOTIF_FILE_UPLOADED object:self];
}] setProgressBlock:^(int64_t bytesWritten, int64_t totalBytesWritten, int64_t totalBytesExpectedToWrite)
{
float percentDone = (float)totalBytesWritten/(float)totalBytesExpectedToWrite*(float)100;
self.alert.message = $str(@Uploading File %0.0f%%\n\n,percentDone);
}];
Thank you,
Eric