Use jquery form plugin for uploading.