-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
AFHTTPRequestOperationManager *mgr=[AFHTTPRequestOperationManager manager];
// mgr.responseSerializer = [AFHTTPResponseSerializer serializer];
[mgr POST:@“http://192.168.0.113:8080/WYServer/upload” parameters:nil constructingBodyWithBlock:^(id<AFMultipartFormData> formData) {
NSURL *url=[[NSBundle mainBundle] URLForResource:@“4444.jpg” withExtension:nil];
//name是传输的文件的类型
[formData appendPartWithFileURL:url name:@“file” fileName:@“1.jpg” mimeType:@“image/jpg” error:nil];
} success:^(AFHTTPRequestOperation *operation, id responseObject) {
NSLog(@“OK”);
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@“error”);
}];
}