let uploadedFiles = new kendo.data.ObservableArray([]);
$("#fileInput").kendoUpload({
async: {
autoUpload: false
},
validation: {
allowedExtensions: [".jpg", ".jpeg", ".png", ".xlsx"]
},
multiple: true,
batch: true,
showFileList: true,
select: onSelect,
remove: onRemove
});
function onSelect(e) {
const files = e.files;
const previewContainer = $("#imagePreviewContainer");
// Loop through selected files and add them to the uploadedFiles array
files.forEach(file => {
uploadedFiles.push(file);
};
i am using this but when i selected multiple files like images then all selected files are come into bulk in one array i want that in seperately one by one
Hi Abhishek,
I am not sure I understand the requirement. The code you mentioned:
function onSelect(e) { const files = e.files; const previewContainer = $("#imagePreviewContainer"); // Loop through selected files and add them to the uploadedFiles array files.forEach(file => { uploadedFiles.push(file); }); };
Loops through the uploaded files and adds them to the uploadedFiles array. What do you need to achieve?
Regards,
Nikolay