I want to customize the error message displayed automatically by kendo upload when I upload a file which exceeds the maximum size.
addedfiles : Array<any> = [];
fileRestrictions: FileRestrictions = {
allowedExtensions: ['.jpg', '.png', '.jpeg', '.doc', '.docx','.pdf'],
maxFileSize: 5000000
};
public onSelect(ev: any): void {
ev.files.forEach((file: FileInfo) => {
if (file.rawFile) {
const reader = new FileReader();
if(this.fileRestrictions.allowedExtensions.includes(file.extension.toLowerCase()))
{reader.addEventListener('loadend', () => {
this.addedfiles.push({ ...file, src: reader.result as string });
});
reader.readAsDataURL(file.rawFile);
}
}
});
}
HTML :
<kendo-upload class="mobile-max-height-240" style="margin-top:2%;" (select)="onSelect($event)"
(remove)="onRemove($event)" [restrictions]="fileRestrictions"></kendo-upload>
Here when I upload a file which exceed the maxFilesize the message : "file size too large" appear ! How can I change this message ?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…