“i have simple form and posting it with ajax, but i am not able to get the $_FILES in php script”
<form id="submitForm" method="post" enctype="multipart/form-data" >
<input type="file" name="file" />
<input type="text" name="name" />
</form>
below is ajax code,tell me where i am mistaken
$.ajax({
url: '<?php echo base_url(); ?>getter/addItemRow',
type:"POST",
data:$('#submitForm').serialize(),
context: $('#table')
}).done(function(data) {
this.prepend(data);
});
below is php code line
print_r(var_dump($_FILES));
this is returning empty array;
all the answers that i got that were all same and RIGHT,this the simple jquery code that will work,all the links that are provided here, were missing .submit() function in the of the ajaxForm,so all the others who are looking for this kind of problem first include the above file in the head then write the above code