i have passed two strings and one list to a controller using an ajax call.From controller i can retrieve my string values. but the list that i passed come as an object. how to convert that object to a list.
this is my ajax
var imagelist = [];
if ('files' in x) {
if (x.files.length == 0) {
alert("Add one or more images");
ss
} else {
for (var i = 0; i < x.files.length; i++) {
imagelist.push(x.files[i]);
}
}
jQuery.ajaxSettings.traditional = true;
$.ajax({
url: url_path,
type: 'POST',
data: {
'pname': pname,
'des': des,
'ilist': imagelist
},
success: function(data) {
alert("test");
},
error: function(request, error) {
alert("error");
}
});
}
controller is
$images = $this->input->post('ilist');
foreach($images as $img){
}
this is the value that $images get
[object File]