是这样的,我用afn上传文件,然后doc和xls的都可以上传成功,但是zip上传失败。我想问问是哪里出了问题。。
代码如下:
NSURLRequest *request = [_httpClient multipartFormRequestWithMethod:@"POST" path:path parameters:nil constructingBodyWithBlock:^(id formData) {
[formData appendPartWithFileData:upData name:@"Content-Disposition:multipart/form-data" fileName:[NSString stringWithFormat:@"%@.%@",fileName,type] mimeType:[NSString stringWithFormat:@"groupFile/%@",type]];
}];
AFHTTPRequestOperation *op = [[AFHTTPRequestOperation alloc] initWithRequest:request];
[op setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:responseObject options:NSUTF8StringEncoding error:nil];
NSLog(@"%@",dic);
NSLog(@"上传成功");
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"上传失败->%@", error);
}];