objective c - how to upload image to server in ios? -


i want upload 1 image server using http post method. requirement in body data should attached byte stream.

i converted image nsdata , attached data body of nsurlrequest. getting 404 in status code of response.

nsmutabledata *body = [nsmutabledata data]; [body appenddata:[nsdata datawithdata:uiimagedata]];  [request sethttpbody:body];  

but getting 404 error in status code.

is byte stream same nsdata ?

if not how send byte stream data server using nsurlconnection ?

thanks in advance.

what url you're using send image to?

a 404 error code translates not found (http://en.wikipedia.org/wiki/http_404), first step should making sure yore using valid url.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -