You might check out my example app for uploading images via ajax-like functionality.
http://github.com/melvinram/ajax-image-upload/