STHTTPRequest多图像上传

时间:2013-08-14 10:08:14

标签: ios iphone connection asihttprequest sthttprequest

我正在更改应用的连接对象,直到昨天我使用了AsiHttpRequest

[request setData:imgDataBig withFileName:@"imagename" andContentType:@"image/jpeg" forKey:@"image"];
[request setData:imgDataThumb withFileName:@"thumbname" andContentType:@"image/jpeg" forKey:@"thumb"];

现在我正在使用SthttpRequest,并复制AsiHttpRequest我尝试过此代码:

[request setDataToUpload:imgDataThumb parameterName:@"thumb" mimeType:@"image/jpeg" fileName:@"thumbname"];
[request setDataToUpload:imgDataBig parameterName:@"image" mimeType:@"image/jpeg" fileName:@"imagename"];

使用SthttpRequest只会发送一个,如何复制我在AsiHttpRequest中完成的多图片上传?

1 个答案:

答案 0 :(得分:3)

解决了,我必须下载最新版本的SthttpRequest,在上一版本中我找到了一种新的多重上传方法:

[request addDataToUpload:imgDataThumb parameterName:@“thumb”mimeType:@“image / jpeg”fileName:@“thumbname”]; [请求addDataToUpload:imgDataBig parameterName:@“image”mimeType:@“image / jpeg”fileName:@“imagename”];