JSON encode photo

Hi,

I need to send a picture taken with the mobile device to a rest webservice using JSON format.
How can I encode the image with lua?

Thanks [import]uid: 189638 topic_id: 32979 reply_id: 332979[/import]

base64 the file and put it in a json tag then push it to the webservice, then on the web service side just decode the base 64 and write the file. [import]uid: 174725 topic_id: 32979 reply_id: 130940[/import]

Here’s a couple helpful links:

http://developer.coronalabs.com/code/how-upload-image-server-multipartform-data

http://developer.coronalabs.com/code/url-safe-base64-encoding-lua

http://developer.coronalabs.com/forum/2010/12/13/lua-php-post-call

That code exchange is a great thing, eh? [import]uid: 79933 topic_id: 32979 reply_id: 130946[/import]

base64 the file and put it in a json tag then push it to the webservice, then on the web service side just decode the base 64 and write the file. [import]uid: 174725 topic_id: 32979 reply_id: 130940[/import]

Here’s a couple helpful links:

http://developer.coronalabs.com/code/how-upload-image-server-multipartform-data

http://developer.coronalabs.com/code/url-safe-base64-encoding-lua

http://developer.coronalabs.com/forum/2010/12/13/lua-php-post-call

That code exchange is a great thing, eh? [import]uid: 79933 topic_id: 32979 reply_id: 130946[/import]