zoukankan      html  css  js  c++  java
  • 多文件上传 iOS功能

     多文件上传 iOS功能,原文来自ios教程网整理的,大家可以看看演示:ios.662p.com ,喜欢的朋友可以看看我的博客吧。

    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

  • 相关阅读:
    豆豆
    艺术家
    姐姐
    书名与歌名
    MySQL
    杂文
    武侠
    青年诗人
    那些歌
    传世
  • 原文地址:https://www.cnblogs.com/chenkaiyuan/p/3696158.html
Copyright © 2011-2022 走看看