Upload image to the PHP server from iOS

Viewed 32892

I know this question has been asked earlier as well but my issue is a bit different.

I want to upload an image to the PHP server and i want to send more parameters along with an image from an iOS. I searched on the google and found two solutions:

  1. Either we will send an image as Base64 encoded string in JSON. Referred link.

  2. Or we will upload an image to server using form data. I have referred this link. If someone refers me this way, then please help me to add more parameters in this API.

Now my question is, which one is the best way to upload an image to the server and i have to send more parameters (username, password and more details) in the same web service call.

Thanks in advance.

6 Answers
Related