Good afternoon, I'm trying to upload image using JS but I'm not getting it, I'm not using jQuery, I'm using Axios.
So far, I've tried it that way
var files = document.getElementById("inputPhoto").files;
axios.post(url+'api.php', {
file: new FormData(imagem])
}, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
})
.then(function(response){
console.log(response)
})
.catch(function(error){
console.log(error)
})
NOTE: I am using the HTML5 multiple, BackEnd is already ready in PHP