Turn a picture into a binary stream using the afnetworking POST to upload to the server.
Afhttprequestoperationmanager *manager = [[Afhttprequestoperationmanager alloc] Initwithbaseurl:[nsurl URLWithString : BaseUrl]];
Manager.responseserializer = [Afjsonresponseserializer serializer];
Manager.requestSerializer.timeoutInterval = timeOutInterval;
[Manager Post:request_updatecompanyinfo parameters:paramdict constructingbodywithblock:^ (id< Afmultipartformdata> formData) {
NSData *data=uiimagepngrepresentation (_userimage);
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
Set the time format
Formatter.dateformat = @ "YYYYMMDDHHMMSS";
NSString *str = [formatter stringfromdate:[nsdate date]];
NSString *filename = [NSString stringwithformat:@ "%@.png", str];
[FormData appendpartwithfiledata:data name:@ "logo_img" Filename:filename mimetype:@ "Image/png"];
} success:^ (afhttprequestoperation *operation, id responseobject) {
[Super stoploadingcompletedwithmessage:@ "submit success"];
[Self.navigationcontroller Popviewcontrolleranimated:yes];
} failure:^ (Afhttprequestoperation *operation, Nserror *error) {
}];
Turn a picture into a binary stream using the afnetworking POST to upload to the server.