I am using ASIHTTPRequest to upload an image to a webservice. my code works fine (i think), but i am not sure how to write the web service so i could retrieve the image and display it (in a web browser).
i don’t know if this is relevant but i’m passing the image data from the iPhone. so the web service now will have to take this image data and convert it to a PNG and display it on the web browser.
I have no clue how to do this. Can someone help me out with a tutorial or sample code to begin with.
note: in ASIHTTPRequest i used the method postData to send the data to the web service
and the web services are supposed to be written in PHP
Use ASIFormDataRequest, it has a method for file uploads (addFile), then you just work off the $_FILES superglobal in PHP as you would with a regular HTML form upload. On the iPhone side you’re best off saving the image to the Documents or Cache folder for your application and referencing the filepath in the request.
Something like this: