In Bootstrap File Input, I'm trying to submit the files through php/laravel post request. When i select multiple files at once, i get all files in the request. However, when files are selected individually one by one and submited i only get the last file in the request. Here is my fileinput configuration
$('#' + input_id).fileinput({
theme: 'fas',
initialCaption: 'No file selected',
allowedFileExtensions: ['jpg', 'jpeg', 'png', 'gif', 'pdf', 'xls', 'csv', 'doc', 'docx', 'xlsx', 'ppt', 'pptx', 'eml'],
uploadUrl: upload_url,
autoUpload : false,
autoReplace: true,
uploadAsync: false,
showCancel: false,
showRemove: false,
showClose: false,
showUpload: false,
maxFileCount: 50,
browseOnZoneClick: true,
showPreview: true,
dropZoneEnabled: true,
hideThumbnailContent: false,
initialPreviewAsData: true,
initialPreview: [],
initialPreviewConfig: [],
overwriteInitial: false,
previewFileIcon: '<i class="fas fa-file"></i>',
allowedPreviewTypes: ['image', 'pdf', 'text'],
previewFileIconSettings: {
'docx': '<i class="fas fa-file-word text-primary"></i>',
'xlsx': '<i class="fas fa-file-excel text-success"></i>',
'pptx': '<i class="fas fa-file-powerpoint text-danger"></i>',
'jpg': '<i class="fas fa-file-image text-warning"></i>',
'pdf': '<i class="fas fa-file-pdf text-danger"></i>',
'zip': '<i class="fas fa-file-archive text-muted"></i>',
},
fileActionSettings: {
showDrag: false,
},
}).on("filepredelete", function (jqXHR) {
var abort = true;
if (confirm("Are you sure you want to delete this image?")) {
abort = false;
}
return abort; // you can also send any data/object that you can receive on `filecustomerror` event
});