我想從iphone上傳圖像到服務器。使用ASIHttpRequest
和ASIFormDataRequest
我已經用字典上傳圖像
[request setdata:...]
成功地uplaoded圖片服務器,但我也想送用戶id到服務器的圖像。如何實現這一目標?這裏是我的代碼...
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"];
使用字典鍵值對,再添加一個用戶ID的鍵。 –
你的請求方法是什麼? – Venkat
這裏是我的代碼你可以告訴我如何使用它的字典 – vivek