Skip to content

Commit

Permalink
Make extension check case insensitive
Browse files Browse the repository at this point in the history
Sometimes files are being save as picture.JPG instead of picture.jpg
  • Loading branch information
fo authored Mar 6, 2017
1 parent 6683db2 commit 86b5a0f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/directives/ng-file-select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 86b5a0f

Please sign in to comment.