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