afnetworking POST multi-part Request upload image

Source: Internet
Author: User

These days in the picture upload, encountered a problem, that is, as long as I append the picture will request time-out, the following is the code:

Afhttprequestoperationmanager *manager = [Afhttprequestoperationmanager manager];    Manager.responseSerializer.acceptableContentTypes = [Nsset setwithobject:@ "text/html"];    Nsurl *filepath = [Nsurl urlwithstring:[nsstring stringwithformat:@ "file://%@", FullPath]];    [Manager Post:url Parameters:nil constructingbodywithblock:^ (id<afmultipartformdata> formData) {        [formData appendpartwithfileurl:filepath name:@ "image" Error:nil];    } success:^ (afhttprequestoperation *operation, id responseobject) {            } failure:^ (Afhttprequestoperation *operation, Nserror *error) {            }];

Because I have other data on my side besides uploading pictures, I use Afnetworking's post multi-part request for data submission. Encountered the problem is: as long as not upload pictures There is no problem, I add append ... Will request time-out, and later updated a bit afnetworking on OK, very strange, perhaps the reason for iOS8 it!

https://github.com/AFNetworking/AFNetworking/

You are welcome to criticize and correct me!

afnetworking POST multi-part Request upload image

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.