Hi, all! Help me, please!!!
I was read all topics with this problem, but not understand that happens…
I don’t receive answer from server in post request.
You are sending the data as a variable called formDdata and then your PHP is looking for a value called formData. You have an extra D in the first one.
I’m sorry, I made a mistake when entering the question. Now i wrote simple:
$$('#imageForm').on('submit', function(){
var f=document.getElementById('input').files[0];
app.request.post('php/photo_load.php', { f: f },
function (data){
console.log( data );
});
});
maybe i used component page, and data not transfer permanently?
I found that no data was being transmitted in the request. This post request start, but not working (
var f=document.getElementById('input').files[0]; /// form input type="file"
var id=document.getElementById('id').value; /// form input type="number"
var FData = new FormData();
FData.append('files',f); /// for file object (on server in $_FILES['files'])
FData.append('id',id); /// for other data (on server in $_POST['id'])
app.request.post('php/photo_load.php', FData, function (data) {
console.log(data);
});