i am posting formdata as below
let redirecturl="<?=base_url()?>admin/forms";
let formData = new FormData()
let posturl = " <?=base_url() . 'admin/forms/post_values';?>";
var filepath = document.getElementById("institute_systemlogo").value;
/*formData.append('file',d);*/
formData.append('form',JSON.stringify(FormArray));
formData.append('file', filepath);
$.ajax(posturl, {
type: 'POST',
data: formData,
enctype: 'multipart/form-data',
async: false,
cache: false,
contentType: false,
processData: false
}, function (response) {
console.log(response);
});
and receiving posted values as $_POST and $_FILES
if i do console.log in my formdata as below
console.log(formData.get("file")+"file here ");
console.log(formData.get("form")+"form here ");
i get the data in console as below
C:\fakepath\logo.png file here
{"field_type":"date","field_label":"dfdf","field_options":"","is_required":false}]form here
Now the problem is that when i receive the $_Files its empty while $_POST value is received , Please help me what am i doing wrong here