diff --git a/README.md b/README.md index 80aaa66c..93c5d895 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,7 @@ export class DemoApp { options: Object = { url: 'http://localhost:10050/upload' }; + sizeLimit = 2000000; handleUpload(data): void { if (data && data.response) { @@ -76,6 +77,13 @@ export class DemoApp { fileOverBase(e:any):void { this.hasBaseDropZoneOver = e; } + + beforeUpload(uploadingFile): void { + if (uploadingFile.size > this.sizeLimit) { + uploadingFile.setAbort(); + alert('File is too large'); + } + } } ```` @@ -84,7 +92,8 @@ export class DemoApp { + (onUpload)="handleUpload($event)" + (beforeUpload)="beforeUpload($event)">