
Kirby enforces a strict naming convention for files uploaded through the panel: all letters are converted to lowercase, and most special characters are replaced with hyphens. It would be helpful to make this behavior configurable, for example by allowing a custom regular expression.

Use case: I have a client who offers downloadable PDFs. The filenames follow a specific pattern, but Kirby’s sanitization process alters them even though they don’t violate any technical naming rules.

Another use case: I implemented HLS streaming, where the setup includes .m3u8 playlists referencing .ts segment files. After uploading, the links in the playlists break because the files are renamed.

What we need to keep in mind is the attack surface. At the moment, Kirby expects filenames to be secure (e.g. against XSS attacks) as they are always “sluggified”. If we allow to change the slug behavior, we need to consider if this has implications elsewhere.
In general I agree that your use cases make sense and can come up in projects.

Idea from https://github.com/getkirby/kirby/issues/7662#issuecomment-3603056463: We could also add an option to still sluggify the filename but automatically store the original name in the file content. This can be useful when the filename contains characters that are not allowed in URLs but you still want to display the original filename somewhere on the site for human-readability.

Thought about this as well and tried to implement it some time ago using the before hook. Back then the $file object could not be modified there though. You fixed that thankfully by now. 😀
The problem here is that changes to the filename in the panel might become very out of sync with the original name. Getting them into sync again would require re-uploading the (locally renamed) file.
To overcome this you would have to be able to edit the ‘original filename’ (which might rather be labeled as ‘readable name’) as well as the slugified version.