Demo---
/**
* //网络的管理者
AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
//地址
NSString *urlstr = @"http://localhost/post/upload-m.php";
NSDictionary *dic = @{@"status":@"使用第三方上传真爽"};
//发送请求
[manager POST:urlstr parameters:dic constructingBodyWithBlock:^(id<AFMultipartFormData> _Nonnull formData) {
//文件1
NSString *filePath = [[NSBundle mainBundle]pathForResource:@"sunli.jpg" ofType:nil];
NSData *fileData = [NSData dataWithContentsOfFile:filePath];
//文件2
NSString *filePath2 = [[NSBundle mainBundle]pathForResource:@"car.jpg" ofType:nil];
NSData *fileData2 = [NSData dataWithContentsOfFile:filePath2];
[formData appendPartWithFileData:fileData name:@"userfile[]" fileName:@"dengchao.jpg" mimeType:@"image/jpg"];
[formData appendPartWithFileData:fileData2 name:@"userfile[]" fileName:@"makalun.jpg" mimeType:@"image/jpg"];
} progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
NSLog(@"responseObject %@",responseObject);
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
NSLog(@"error %@",error);
}];
[formData appendPartWithFileData:fileData name:@"userfile[]" fileName:@"dengchao.jpg" mimeType:@"image/jpg"];