Open geertjanknapen1 opened 4 months ago
You can opt-out of filenames being converted to lowercase, by toggling the lowercase
config option in your config/statamic/assets.php
config file.
/*
|--------------------------------------------------------------------------
| Enforce Lowercase Filenames
|--------------------------------------------------------------------------
|
| Control whether asset filenames will be converted to lowercase when
| uploading and renaming. This can help you avoid file conflicts
| when working in case-insensitive filesystem environments.
|
*/
'lowercase' => true,
But that wouldn't be on an asset container-based level, right? If I set this to false it would happen for all my containers, right?
Correct.
There's currently no way to set it on a per-container basis. Good idea though!
For a project, I need to be able to display assets in the browser (they are PDF files). Due to these PDF files being technical documents, there are already QR codes made for these files (
mywebsite.test/files/MyFile.pdf
)As you can see they are camel-cased.
When uploading an asset, Statamic does:
in_array(trim(strtolower($file->getClientOriginalExtension())), $extensions)
. So I cannot upload files with uppercased characters in the filename. For me, this is an issue at the moment, but it's pretty niche of course.I would like to propose a new setting on the asset container that makes us able to toggle between allowing and disallowing uppercased characters? Of course defaulting to uppercase not allowed.
Again, this is a niche problem, but maybe something other people will run into as well.
Where the code is located:
src/Validation/AllowedFile/IsAllowed()
It looks like this;