Open avi-s opened 6 years ago
This can be easily solved by :
`
const filesNotMatchExtensions = filesArray.filter((file: File) => { const extensionsList = (acceptExtensions as string) .split(', ') .map(extension => extension.slice(1).toLowerCase()) .join('|');
const regexp = Ng4FilesUtilsService.getRegExp(extensionsList);
let fileName = file.name; if(fileName) { fileName = fileName.toLowerCase(); } return !regexp.test(fileName); });
`
If you have added a specific extension in the acceptExtensions field in the config and try to upload a file with the same exact extension but in uppercase, the file in not verified.
(for example png is added to acceptExtensions but the user tries to upload a file with a PNG extension)
even if you try and add that extension in uppercase to the acceptExtensions field it still won't work.
There is a function called transformAcceptExtensions which is a part of a bigger function called newConfigVerifyPipeline under the addConfig function [all in ng4-files.service.ts] which converts all the extensions added in acceptExtensions to lowercase.
But when a file is added and is verified using the verifyFiles function [ng4-files-utils.service.ts] the file name is not converted to lowercase in order to be matched by the regex built by the acceptable extensions [which all of them have been converted to lowercase as I explained above].
So somehow the whole acceptExtensions and verifying files becomes unusable because it will bring up a lot of trouble with the users.