hello guys my html code :
as you see a single file, multiple files, and I have one text value. This value 'ajax' with want to send at a time. 'JQuery' I use.
I can not run in any way
$(function(){
$('input[type="submit"]').click(function(e){
e.preventDefault();
var file_data = $('#poster').prop('files')[0];
var form = $('form').serialize();
var form_data = new FormData();
$.each($('input[name="scene[]"]'),function(i, obj) {
$.each(obj.files,function(j,file){
form_data.append('photo['+i+']', file);
})
});
form_data.append(form);
form_data.append('file',file_data);
alert(form_data);
$.ajax({
url:'post.php',
cache:false,
contentType:false,
processData:false,
async:false,
data:form_data,
type:'post',
success:function(answ){
$('#result').html(answ);
}
})
})
})
I looked at other similar solutions, but it did not fix my problem
and sory my bad english .