Multile files upload

0 Answers 36 Views
Upload
Abhishek
Top achievements
Rank 1
Abhishek asked on 28 Nov 2024, 07:11 AM

 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 

Nikolay
Telerik team
commented on 02 Dec 2024, 02:35 PM

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

No answers yet. Maybe you can help?

Tags
Upload
Asked by
Abhishek
Top achievements
Rank 1
Share this question
or