zoukankan      html  css  js  c++  java
  • iOS 七牛多张图片上传

    -(void)uploadImages:(NSArray *)images atIndex:(NSInteger)index token:(NSString *)token uploadManager:(QNUploadManager *)uploadManager keys:(NSMutableArray *)keys{
        UIImage *image = images[index];
        __block NSInteger imageIndex = index;
        NSData *data = UIImageJPEGRepresentation(image, 0.5);
        NSTimeInterval time= [[NSDate new] timeIntervalSince1970];
        NSString *filename = [NSString stringWithFormat:@"%@_%ld_%.f.%@",@"status",686734963504054272,time,@"jpg"];
        [uploadManager putData:data key:filename token:token
                      complete:^(QNResponseInfo *info, NSString *key, NSDictionary *resp) {
                          if (info.isOK) {
                              [keys addObject:key];
                              NSLog(@"idInex %ld,OK",index);
                              imageIndex++;
                              if (imageIndex >= images.count) {
                                  NSLog(@"上传完成");
                                  for (NSString *imgKey in keys) {
                                      NSLog(@"%@",imgKey);
                                  }
                                  return ;
                              }
                              [self uploadImages:images atIndex:imageIndex token:token uploadManager:uploadManager keys:keys];
                          }
            
        } option:nil];
    }
    
  • 相关阅读:
    drf规范——请求与响应
    序列化器——Serializer
    drf 安装与配置
    CBV源码——View,APIView
    django restful framework —— Drf 规范一
    Vue——五
    Vue——四
    今日复习
    冒泡排序
    考试总结
  • 原文地址:https://www.cnblogs.com/damiao/p/5127644.html
Copyright © 2011-2022 走看看