我想将图像从 iphone 上传到服务器。使用ASIHttpRequest
并且ASIFormDataRequest
我已经成功地将图片上传到服务器
[request setdata:...]
但我也想将 userId 发送到带有图像的服务器。如何做到这一点?这是我的代码...
ASIFormDataRequest *_request = [ASIFormDataRequest requestWithURL:[NSURL URLWithString:URLSaveImage]];
__unsafe_unretained ASIFormDataRequest *request = _request;
[ASIHTTPRequest setShouldThrottleBandwidthForWWAN:YES];
[request setUploadProgressDelegate:self];
NSData *data=UIImageJPEGRepresentation(proImage.image,1.0);
[request setData:data
withFileName:@"profile.jpg"
andContentType:@"image/jpeg"
forKey:@"file"];