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.<
jQuery("#changePicture").click(function(){
var file_name=jQuery("#imageInput").val();
var fileName = jQuery("#imageInput").val();
var fileExtension = fileName.substring(fileName.lastIndexOf('.') + 1);
var base_url = 'Oppa/view/photo.php';
var file_data=jQuery("#imageInput").prop("files")[0];
var form_data=new FormData();
form_data.append("file",file_data);
jQuery.ajax({
type:"POST",
url: base_url,
datatype:'script',
cache:false,
contentType:false,
processData:false,
data:form_data,
success:function(){
//------------
},
error:function(){
//----------
}
});
jQuery("#imageInput").val('');
})
i hope this would help for you n don't forget to like my ans