I did this for uploading files via ajax. But I can't get any file data. It shows file data empty.
Here is my ajax part.
$("#personal_image").on('click',function(event) {
event.preventDefault();
var datastring = $("#personal_image").serialize();
console.log(datastring);
$.ajax({
type: "POST",
url: location.origin+"/user/parsonal_image_submit/",
secureuri :false,
fileElementId :'user_image',
data: datastring,
dataType: "json",
success: function(data) {
//success },
error: function() {
//error
}
});
})