怎样实现多文件上传 在iOS开发中
[html]
NSURL* url = [NSURL URLWithString:@"xxx"]; 
    ASIFormDataRequest* request = [ASIFormDataRequest requestWithURL:url]; 
    request.uploadProgressDelegate = viewPost.progressView; 
    request.showAccurateProgress = YES; 
    request.shouldContinueWhenAppEntersBackground = YES; 
     
    if ([imageArray count] > 0) 
 { 
        [request setPostFormat:ASIMultipartFormDataPostFormat]; 
        for (NSData* data in imageArray) { 
            NSInteger idx = [imageArray indexOfObject:data]; 
            [request addData:data withFileName:[NSString stringWithFormat:@"image%d.png",idx] andContentType:@"image/png" forKey:@"photos[]"]; 
        } 
    } 
NSURL* url = [NSURL URLWithString:@"xxx"];
    ASIFormDataRequest* request = [ASIFormDataRequest requestWithURL:url];
    request.uploadProgressDelegate = viewPost.progressView;
    request.showAccurateProgress = YES;
    request.shouldContinueWhenAppEntersBackground = YES;
   
    if ([imageArray count] > 0)
 {
        [request setPostFormat:ASIMultipartFormDataPostFormat];
        for (NSData* data in imageArray) {
            NSInteger idx = [imageArray indexOfObject:data];
            [request addData:data withFileName:[NSString stringWithFormat:@"image%d.png",idx] andContentType:@"image/png" forKey:@"photos[]"];
        }
    }
相关新闻>>
- 发表评论
- 
				
- 最新评论 进入详细评论页>>









![[iPhone中级]iPhone团购信息客户端的开发 (二)](/uploads/allimg/131022/200H11235-0-lp.png)
