From 86b5a0fe91651e58fd31cc8f959d13c8cd6cdabe Mon Sep 17 00:00:00 2001 From: fo Date: Mon, 6 Mar 2017 14:21:14 +0100 Subject: [PATCH] Make extension check case insensitive Sometimes files are being save as picture.JPG instead of picture.jpg --- src/directives/ng-file-select.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/directives/ng-file-select.ts b/src/directives/ng-file-select.ts index 506eaaaa..67d89b05 100644 --- a/src/directives/ng-file-select.ts +++ b/src/directives/ng-file-select.ts @@ -76,7 +76,7 @@ export class NgFileSelectDirective implements OnChanges { if (this.options.filterExtensions && this.options.allowedExtensions && this.files && this.files.length) { this.files = [].filter.call(this.files, (f: File) => { let allowedExtensions = this.options.allowedExtensions || []; - if (allowedExtensions.indexOf(f.type) !== -1) { + if (allowedExtensions.toLowerCase().indexOf(f.type.toLowerCase()) !== -1) { return true; }