With AFNetworking I am trying to download an image (1280x990) with a size: 33695. The code below works fine with smaller images (that is: 390x390), but a larger image causes an error:
[client POST:@"/upload_image" parameters:nil constructingBodyWithBlock:^(id <AFMultipartFormData>formData) { [formData appendPartWithFileData:imageData name:@"image" fileName:@"image.jpg" mimeType:@"image/jpeg"]; } success:^(NSURLSessionDataTask * task, id responderData) { } failure:^(NSURLSessionDataTask * task, NSError * error) { }];
ERROR thrown:
NSDebugDescription = "JSON text did not start with array or object and option to allow fragments not set.";
I searched for a lot of other posts, and it seems nothing is said about the problems with the large image size. Any suggestions?
source share