Embedding a File Attachment in JSON Object
file, html, java, json
Solution
If you want to send the actual data of the file, you'd probably want to encode it as a base64 string and send that in your `JSON` - see fiddle for example of encoding it in javascript:
http://jsfiddle.net/eliseosoto/JHQnk/
Then you could do the opposite on your server-side using whatever language and/or libraries are appropriate.
Problem
Is it possible to embed a file attachment in a JSON Object. I have a HTML Form, which has several text field inputs and a file attachment. I want to send a JSON Object wrapping all these form data (including the file attachment) to the server. Are there any particular libraries in Java available to do that? Can you give possible solution for this. Thanks