You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Assuming the script is used with the 'fileType' parameter set as '.jpg,.jpeg,.gif,.png' like in the Sample file, when sending an image named, let's say, IMG_4567.JPG, the javascript will reject the file, applying the status "Forbidden File Type" to it.
To correct this, this part of the javascript file:
// Create an array of file types
var file_types;
if (settings.fileType) {
file_types = settings.fileType.split(',');
}
Could simply be changed to:
// Create an array of file types
var file_types;
if (settings.fileType) {
file_types = settings.fileType.split(',');
file_types = $.merge( $.merge( [], file_types ), file_types.map(item => item.toUpperCase() ));
}
This way, files can be treated whether their name is "IMG_4567.jpg" or "IMG_4567.JPG".
That probably got forgotten on the way, as the equivalent is done in the PHP file, so there's no need to modify anything in it for the bug to be fixed.
The text was updated successfully, but these errors were encountered:
legibe-com
changed the title
Improvement/bug: Allow file types in uppercase as well
Bug: Files with extensions in uppercase get a "Forbidden File Type" error
Dec 1, 2022
Hi!
Assuming the script is used with the
'fileType'
parameter set as'.jpg,.jpeg,.gif,.png'
like in the Sample file, when sending an image named, let's say, IMG_4567.JPG, the javascript will reject the file, applying the status "Forbidden File Type" to it.To correct this, this part of the javascript file:
Could simply be changed to:
This way, files can be treated whether their name is "IMG_4567.jpg" or "IMG_4567.JPG".
That probably got forgotten on the way, as the equivalent is done in the PHP file, so there's no need to modify anything in it for the bug to be fixed.
The text was updated successfully, but these errors were encountered: