convert to ajax uploading