From 12f8a075b0b805718bd0c022007d343019538234 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 --- package.json | 2 +- src/directives/ng-file-select.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 46d8fe14..1b54d225 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ngx-uploader", "description": "Angular File Uploader", - "version": "2.2.1", + "version": "2.2.2", "license": "MIT", "main": "bundle/ngx-uploader.umd.js", "module": "ngx-uploader.js", 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; }