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
After selecting a file in kendoUpload two buttons show up: Upload and Clear:
Is it possible to hide those two buttons? I want to do the upload process programmatically.
I already found out that the two buttons are not accessible after initialization of the kendoUpload widget but also not right away after the SELECT event triggers (on selecting a file to be uploaded). I have found a solution waiting some milliseconds in the SELECT event to hide the two buttons:
setTimeout(function() {
$('k-actions').css('display', 'none');
}, 10);
Is there a more proper way to hide those buttons?
I'm working with KendoUI for JQuery, very latest official version.
Regards
Hi,
We've using a Form component with an Upload component in it. The validation within the Upload works fine but we'd like to check whether a file has been uploaded and / or selected. The "required" part of the Form validation doesn't seem to trigger when no file is selected. Code provided is an item in the Form.
{
field: "mailingList",
label: "Mailing List",
colSpan: 2,
editor: function (container, options) {
$('<input type="file" name="' + options.field + '" id="' + options.field + '"/>').appendTo(container)
.kendoUpload({
async: {
saveUrl: "/rates-notices-campaign/save-attach/" + id,
removeUrl: "/rates-notices-campaign/remove-attach/" + id,
autoUpload: true
},
validation: {
allowedExtensions: [".csv", ".xlsx"]
}
});
},
validation: {
required: {
message: "Mailing List is required"
}
}
}
Thanks
I use the upload widget in a long-running web app to allow picture upload.
Over the years, the number and size of pictures have increased.
I compress property in the upload widget would be great, however, short of this, has anyone played around with compressing images in the browser in connection with using the upload widget?
/Morten
Hello,
is there a way to implement an upload directly from browser to S3 bucket using Kendo JQuery component?
It's possible with JS, but the idea is to use fancy Upload component with drag-n-drop and progress bar.
Thanks in advance.
Hi,
I need to send some dynamic parameters, (path and others), when uploading files from js.