Following code (shortened for simplicity):
<kendo-fileselect
id="files"
formControlName="files"
[restrictions]="this.fileRestrictions"
(select)="onFileSelect($event)">
<ng-template kendoFileSelectFileInfoTemplate let-files>
---- shows name and validationerrors ----
</ng-template>
</kendo-fileselect>
async onFileSelect(ev: SelectEvent) {
ev.files.forEach(currentFile => {
if (currentFile.rawFile) {
this.readFile(currentFile.rawFile).then(content => {
let attachment = (<AttachmentModel>{filename: currentFile.name, content: content});
this.attachmentClient.isValid(attachment, this.tenant).subscribe(
isValid => {
if (!isValid) {
currentFile.validationErrors = currentFile.validationErrors ?? [];
currentFile.validationErrors.push("malwareFound");
} } ); } ); } }); }
Explaination: I'm checking for malware here (via this.attachmentClient.isValid on server-side).
My problem: It shows the validationerror, but still adds the file to value of the control. For example it doesn't add a file with a wrong extension (restricted via kendo-fileselect restrictions) How can I set my malware-file to not end up in value? I've tried ev.preventDefault(), but this removes the file completely from the list (and I don't see the validationerror)
Screenshot:
- first file: not allowed filetype -> is not in value of control
- second file: malware -> is still in value of control
Regards
Hi, I would like to get a structured response from a controller invoked by a component. in the UploadsModule module (kendo-upload).
I send a text file that is processed server side.
I would like to send the processed object back to the component that sent the original file?
Could be done?
Thanks for your help,
Francesco Aperti
I m using kendo-upload file control as below.
<kendo-upload formcontrolname="cfile" [saveurl] = "fileurl" [upload] ="uploadhandler" >
I could not use interceptor as my existing saveurl request is done by http not through httpclient.Also how i can calculate the file upload percentage
how to upload files and select additional metadata by using the Kendo angular UI Upload control. I saw this is available in kendo UI for Jquery but we need in kendo UI for Angular. Below is the Jquery example. We need same control in Kendo angular UI .Is it available?
https://docs.telerik.com/kendo-ui/controls/editors/upload/how-to/select-additional-metadata
How can I show the File Too Large error message in my own custom kendoFileSelectFileTemplate?
What do I need to do?
I have two goals.
1) Change the button text from "Select File..." to whatever I want; in this case "Upload"
2) Display it as a normal size form control instead of the very large size that it defaults to.
Thanks,
Matt
I see this is online help:
https://www.telerik.com/kendo-angular-ui/components/uploads/upload/how-to/local-file-processing/
As of version 5.2.0 the Kendo UI Upload for Angular features a built-in FileSelect component. You could use this component instead of the approach suggested in the article below.
But I do not see an example of how to do this with fileselect?
Can you please provide an example or point me to the documentation that describes it in detail?