iosiphoneconnectionasihttprequeststhttprequest

STHTTPRequest Multi Image upload


I'm changing the connection object of my app, untill yesterday I have used AsiHttpRequest:

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

Now I'm using SthttpRequest, and to replicate the AsiHttpRequest I've tried this code:

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

With SthttpRequest only one will be send, How I can do to replicate the multi image upload that I have already done in AsiHttpRequest?


Solution

  • Solved, i have to download the last version of SthttpRequest, in last version i've found a new method for multiple uploads:

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