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];
    }
    
  • 相关阅读:
    数据后台查询分页条件查询数据
    避免js缓存
    jquery点击按钮
    网页内容打印
    数据表的导出
    C#实现字符串按多个字符采用Split方法分割
    JQuery
    AJAX
    JSON
    BOM
  • 原文地址:https://www.cnblogs.com/damiao/p/5127644.html
Copyright © 2011-2022 走看看