1

Is there any way to allow () in asset file names (ex. file(1).txt)? Craft strips it out when it saves. The only way I've found is to change it via ftp and update asset indexes.

I've set convertFilenamesToAscii => false but that didn't help.

  • I know it doesn't answer your question, but I'd recommend from personal experience staying with sanitized, non-utf8 filenames. UTF8 filesystem is a slippery slope to go down even if your server permits it... – Urs Sep 16 '18 at 13:25
2

I can't see a way... uploads ultimately get run through FileHelper::sanitizeFileName(), which has a hard-coded list of disallowed characters in a file name (including parenthesis).

https://github.com/craftcms/cms/blob/develop/src/helpers/FileHelper.php#L128-L166

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.