码迷,mamicode.com
首页 > 移动开发 > 详细

多文件上传 iOS

时间:2015-01-17 18:11:20      阅读:244      评论:0      收藏:0      [点我收藏+]

标签:

[1].[代码] [其他]代码 跳至 [1]

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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[]"];
        }
    }

多文件上传 iOS

标签:

原文地址:http://blog.csdn.net/u014311077/article/details/42805323

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!