Here is the html form usees html file to upload image...
<html>
<head>
<script src="js/jquery-3.3.1.min.js"></script>
</head>
<body>
<form method="" action="" enctype="multipart/form-data" id="eventImageForm">
<label for="event"><p><b>Update Event Below: </b></p></label>
<input type="text" class="eventTextBox" id="updateEvent" name="event" placeholder="Update Event" />
<input type="file" id="eventUpdateImgFile" name="updateEventImageFile" />
<input type="submit" class="eventUpdateBtn" id="btnUpdate" name="eventUpdateSubmit" value="Update"></input>
</form>
<div class="updateResult">
</div>
Here is the jquery ajax code below which receives html file info from the html form above and i want to get the details of the file element when user clicks the update button. when the upload is successful...
<script>
$(document).ready(function(){
$("#btnUpdate").click(function(e){
e.preventDefault();
var formData = new FormData($("#eventImageForm")[0]);
$.ajax({
url: "update.php",
type: "POST",
data: formData,
contentType: false,
processData: false,
success: function(){
//Here i want the file element upload details to be displayed...
$(".updateResult").css('display', 'block').html("Data Updated ");
}
})
});
});
</script>
</body>
</html>
Please can anyone help me how to get the file details... please...