Here is my piece of code.
process.php
$image = $_POST['image'];
index.php
<script>
function save(){
var image = document.getElementById('image').files[0].name;
$.ajax({
type: "POST",
url: 'process.php',
data: {
image: image
},
});
}
</script>
<input type="file" class="custom-file-input" id="image" name="image">
This basically returns only the file name to database mysql, but I don't know how to move the file from folder A to folder B. Which is the folder A is where the origin of the image lives, the folder B is when I want to call the image, I go with the path of folder B.
Is it possible to move the image by $_POST not $_FILES? Because so far I only find the $_FILES.