haisergeant
haisergeant

Reputation: 1111

iPhone: how to send image data to server using JSON?

I am newbie iphone developer, I am using JSON to send and retrieve data from server. But I used to work with text between iPhone and server. Now I would like to send image data from iPhone to server and vice versa, retrieve image data from server database to iphone. Can anyone show me how I can accomplish this?

Thanks

Upvotes: 1

Views: 1981

Answers (1)

Tseng
Tseng

Reputation: 64200

Encode your image with base64, then send the base64 string as json. On the serverside decode the base64 again and save it or do whatever you want with it

Upvotes: 4

Related Questions