多文件上传 iOS功能,原文来自ios教程网整理的,大家可以看看演示:ios.662p.com ,喜欢的朋友可以看看我的博客吧。
class="brush:csharp;gutter:true;">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[]"]; } }
详细说明:http://ios.662p.com/thread-1651-1-1.html