iphone - ASIFormDataRequest returning error -



iphone - ASIFormDataRequest returning error -

i getting problem when request server upload , uimage

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]);

it giving responses

responsestatuscode 200

responsestatusstring error: no file uploaded

do 1 know this, doing mistake,

your help much appreciated.

thank you

instead of

[request setdata:imagedata withfilename:@"image.jpg" andcontenttype:@"image/jpeg" forkey:@"photo"];

try

[request adddata:imagedata withfilename:@"image.jpg" andcontenttype:@"image/jpeg" forkey:@"photo"];

i did same help of asihttprequest , images posted on server. should work guess working in 1 of live project.

iphone upload asihttprequest asiformdatarequest

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -