numero2 / contao-proper-filenames

Replaces special characters in filenames right after upload.
https://www.numero2.de/contao/erweiterungen/proper-filenames.html
GNU Lesser General Public License v3.0
13 stars 5 forks source link

Feature: Make file name length adjustable #1

Closed Aybee closed 7 years ago

Aybee commented 7 years ago

Is there a special reason why filenames gets truncated to 32 chars? Can you make this optional or adjustable?

bennyborn commented 7 years ago

Actually no, no special reason.

I created this extension to keep people from going wild when naming files since (as you might know, otherwise you wouldn't be here) using all sorts of special characters and casing can cause some real trouble on the webserver.

So if I already limit the kind of characters to be used why not limit the filename itself in length? It surely results in a better readable filename than thisfileisatotallyawesomeandbecauseofsomereasoniwilltrytomakethefilenameasdescriptiveaspossible.txt

Aybee commented 7 years ago

Yes I know. Thats why I tried your extension. But unfortunately just my very first test comes up with a bad result. Trinkwasser Mönchengladbach Windberg.txt => trinkwasser-moenchengladbach-win.txt

So you can see, that its obviously better if it becomes trinkwasser-moenchengladbach-windberg.txt

bennyborn commented 7 years ago

Well, for now you could simply set the limit higher in CheckFilenames.php#L74. I will try to add a setting to disable to limit as soon I've got some time.

Aybee commented 7 years ago

Yes I know where to increase the limit. Thank you for accepting this feature request.

Aybee commented 7 years ago

Vielen Dank.