What I want to do is whenever a user selects a picture and click the button it will move the image to a specific folder and save the link to the database user_image column.<
try this,
var data= false;
if (window.FormData) {
data= new FormData();
}
var email = $('#email').val();
if (formdata) {
data.append("image", $('input[type=file]')[0].files[0]);
data.append("email","+email+");
data.append("fileName",$('input[type=file]')[0].files[0].name);
}
if (data) {
jQuery.ajax({
url: "php/upload.php",
type: "POST",
data: data,//Now you attached form datas with filename also,
processData: false,
contentType: false,
success: function (data) {
alert("Response Data : "+data);
}
});
}