Hi Team,
I am trying to extend the fileupload.js functionality. There are few more special characters like 'à','ç' (continuous pressing of 'A'/'C' in the keyboard will popup these values). So how can I restrict those values ?
Thanks,
Solved! Go to Solution.
Hi @Shetty1191 ,
To achieve this, we would need to overlay the fileupload.js in : /libs/dam/gui/coral/components/commons/fileupload/clientlibs/fileupload/js/fileupload.js
After overlaying that in apps, you would need to:
Add the values/characters which you need to restrict in the _ILLEGAL_FILENAME_CHARS variable (separate them with ,) on line103. - This is the variable which takes care of all the restricted words.
I think the DamFileUpload and DamFolderUpload both use this same variable.
Hi @Shetty1191 ,
To achieve this, we would need to overlay the fileupload.js in : /libs/dam/gui/coral/components/commons/fileupload/clientlibs/fileupload/js/fileupload.js
After overlaying that in apps, you would need to:
Add the values/characters which you need to restrict in the _ILLEGAL_FILENAME_CHARS variable (separate them with ,) on line103. - This is the variable which takes care of all the restricted words.
I think the DamFileUpload and DamFolderUpload both use this same variable.
give the complete file path which u are trying to overlay ..and what u want to restrict
ILLEGAL_FILENAME_CHARS: ['*', '/', ':', '[', '\\', ']', '|', '#', '%','{','}','?', '&','à','ç'],
It should work ..please check
It is possible to give a regex pattern to it instead of adding all the characters ?
Hi @Shetty1191 ,
Please try using the following regex, it covers almost all accented characters:
^[\u00C0-\u00FF]*$
Add this regex to ILLEGAL_FILENAME_CHARS to disallow the accented characters to be used in filename.
Thanks.
Views
Likes
Replies
Views
Like
Replies