AsiHttprequest.m 文件中的崩潰。我使用字節格式發送UIImage到服務器中。
NSMutableData *imageData = [UIImageJPEGRepresentation(image, 1.0f) mutableCopy];
[request setPostBody:imageData];
[request addRequestHeader:@"fileName" value:[[imageArray objectAtIndex:selectedIndex] filename]];
[request setDelegate:self];
[request startAsynchronous];
請幫忙看一下謝謝。
試試這兩個方法:
[request setFile:@"File Path" withFileName:@"image.png" andContentType:@"image/png" forKey:@"file"];
[request setData:Data withFileName:@"image.png" andContentType:@"image/png" forKey:@"file"];