Question

What are valid file names used on Apache server? Is it OS dependent?
I am using UwAmp on win7 locally but servers are linux based. I an aware of capital letters difference. But this is OS.

What chars should be omitted/blacklisted? I have found this answer but I'm not sure it applies to all cases.

Equally important, are there any pitfalls of using only numbers/digits in file name? Like 1.jpg, 2.jpg, 445545.png

This is ok link but I don't know if it can be applied to Apache.

Was it helpful?

Solution

As mentioned in the comment - file naming is always handled by the OS and not the underlying server software. Linux supports a wide-variety of characters for file naming so I will skip listing what it supports since it's googleable.

As for your question - are there any pitfalls in naming the files - if the OS can understand the characters and save the file then there are no pitfalls, from the OS POV. As from your POV - it depends. If you want to auto-increment a number and save file under that name then just make sure you don't overwrite something. Good practice is not to stick too many files in a directory. Reason for that is that at some point you will ls it and you don't want to see 10 000 files listed (or more).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top