0
我得到一个问题,当我请求到服务器的上传和的uImageASIFormDataRequest返回错误
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]);
它给这个答复
responseStatusCode 200
responseStatusString Error: No file uploaded
是否有任何人知道这件事,我在哪里做错了,
你的帮助是非常感谢。
谢谢
谢谢Jennis!我曾尝试使用addData:但它仍然显示“错误:没有文件上传”,它可能是我的服务器的问题!? – Ganesh