I'm using AFNetworking
in my app to make possible client-server communication. Its working great. But today, our tester encounter an issue, that we can't upload an image to the server on device which having iOS 7.0. and 7.1. (Note: we're targeting app from iOS 7.0. >= versions) We've encountered this on simulator as well.
Have someone ever encounter this before? I'm not posting the code as its working with iOS 8 and later versions. So I'm sure, there's no issue with the code. However, I think, the issue may inside AFNetworking
framework?
PS.
AFNetworking
framework. AFHTTPSessionManager
to call my API. (Available from iOS 7.0.) Please help!
Let me know, if you want more info. on this.
Please check with this code:
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
AFHTTPRequestOperation *op = [manager POST:urlString parameters:params constructingBodyWithBlock:^(id<AFMultipartFormData> formData) {
[formData appendPartWithFileData:imageData name:@"image" fileName:@"photo.png" mimeType:@"image/png"];
} success:^(AFHTTPRequestOperation *operation, id responseObject {
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
}];
[op start];
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.