In my index.php I have a form where a file upload will happen
<form id="uploadImage" method="post" action="upload.php">
<span class="input-group-text">
<label for="attach-doc" class="attachment-icon mb-0">
<i data-feather="image" class="cursor-pointer lighten-2 text-secondary"></i>
<input type="file" name="uploadFile" id="uploadFile" accept=".jpg, .png" /> </label></span>
</form>
I have a jquery for ajax submit as
$('#uploadFile').on('change', function(){
$('#uploadImage').ajaxSubmit({
// target: "#editor1 .ql-editor",
// resetForm: true
});
});
And my upload.php code is
<?php
//upload.php
if(!empty($_FILES))
{
if(is_uploaded_file($_FILES['uploadFile']['tmp_name']))
{
$ext = pathinfo($_FILES['uploadFile']['name'], PATHINFO_EXTENSION);
$allow_ext = array('jpg', 'png');
if(in_array($ext, $allow_ext))
{
$_source_path = $_FILES['uploadFile']['tmp_name'];
$target_path = 'upload/' . $_FILES['uploadFile']['name'];
if(move_uploaded_file($_source_path, $target_path))
{
echo '<p><img src="'.$target_path.'" class="img-thumbnail" width="200" height="160" /></p><br />';
}
//echo $ext;
}
}
}
?>
So as per the code when I click on the upload file a ajax call should happen and the image should be uploaded to the folder upload .
But upload is not happening with the above code, Any help appreciated.

ajaxSubmit()is not a standard jQuery method) correctly?$_FILESare empty or not? Have you checked the value of$_FILES['uploadFile']['error']? Please do some basic debugging and report your findings.uploadfolder