You can't post files through ajax and should not try to post them as JSON. Using JSON might look elegant but it's much more inefficient as any binary data would have to be base64 encoded.
You have to do a regular HTTP post as the article that you linked to.
However, if all your users have a browser that supports HTML5 you can do ajax uploads: How can I upload files asynchronously?
If not, you have to use some sort of flash upload component or use IFRAME:s.