Telerik Forums
Kendo UI for Angular Forum
1 answer
74 views

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

Stefani
Telerik team
 answered on 10 Oct 2023
1 answer
58 views
Multiple files will upload if they are all from a single filepath on the users computer, however when files from multiple local paths are selected for upload only the files from the most recently selected filepath will upload. This is all despite the UI window displaying all selected files. Is this a limitation of the component? Or is there something I've missed in the documentation?
Slavena
Telerik team
 answered on 15 Jun 2023
1 answer
96 views

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

Lance | Senior Manager Technical Support
Telerik team
 answered on 30 Jun 2022
1 answer
259 views
If I have a <kendo-fileselect [restrictions]="myRestrictions">  and within this I have my own kendoFileSelectFileTemplate, I no longer see file restriction errors. How can I see these using a custom kendoFileSelectFileTemplate?
Dimiter Madjarov
Telerik team
 answered on 22 Apr 2022
1 answer
897 views

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

Dimiter Madjarov
Telerik team
 answered on 23 Feb 2022
1 answer
86 views

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

Dimiter Madjarov
Telerik team
 answered on 16 Dec 2021
1 answer
76 views

How can I show the File Too Large error message in my own custom kendoFileSelectFileTemplate?

What do I need to do?

Yanmario
Telerik team
 answered on 16 Jun 2021
3 answers
271 views
I have form where I am getting a path returned from an API.  I'd like to use file selector to select a file from that path.  Is there anyway to accomplish that? 
Martin Bechev
Telerik team
 answered on 27 Aug 2020
1 answer
199 views

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

Preslava
Telerik team
 answered on 16 Jun 2020
2 answers
95 views

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?

Steven
Top achievements
Rank 1
 answered on 02 Jun 2020
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?