简体   繁体   中英

Not getting file size in dropbox for iOS

I am working on dropbox integration with iOS and I've done everything what I suppose to do, I am getting files and can download too, but I cant get file size of before download or in meta information. Here is how I am doing in View Did Load.

if ([[DBSession sharedSession] isLinked]) {
    [self showProgressHud];
    [[self restClient] loadMetadata:@"/"];
}


- (void)restClient:(DBRestClient *)client loadedMetadata:(DBMetadata *)metadata {
if (metadata.isDirectory)
{
    [self hideProgessHud];
    fileList=[[NSMutableArray alloc]initWithCapacity:0];

    for (DBMetadata *file in metadata.contents)
    {
        [fileList addObject:file];
}
}

getting nil response on file.totalBytes Kindly guide me how to get file size before downloading file size in dropbox Than,s

DBMetadata contains information about files it contains totalBytes and humanReadableSize

for (DBMetadata *file in metadata.contents)
{
    NSLog(@“file size: %@”,file.humanReadableSize);
    // file.humanReadableSize contains size in NSString
    [fileList addObject:file];
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM