当我请求服务器上传和 UImage 时出现问题
NSString *jpgPath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/image.jpg"]; //UIImage *img = pickerImage;
[UIImageJPEGRepresentation(postingImage, 0.5) writeToFile:jpgPath atomically:YES];
NSData *imageData = UIImageJPEGRepresentation(postingImage, 0.5);
NSURL *url = [NSURL URLWithString:serverURL];
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
[request setData:imageData withFileName:@"image.jpg" andContentType:@"image/jpeg" forKey:@"photo"];
[request startSynchronous];
NSLog(@"responseStatusCode %i",[request responseStatusCode]);
NSLog(@"responseStatusString %@",[request responseString]);
它给出了这个回应
响应状态代码 200
responseStatusString 错误:没有上传文件
有谁知道这件事,我在哪里做错了,
非常感谢您的帮助。
谢谢