0

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.

Community
  • 1
  • 1
CoR
  • 3,826
  • 5
  • 35
  • 42
  • It's not Apache but OS dependent. Whatever you want Apache to look up in the OS filesystem is validated by the OS, not Apache, given the fact that the request has properly encoded characters and such (which browsers usually do for us). – N.B. May 15 '14 at 15:13
  • Ok. What about numeric file names? Any pitfalls, OS specificity's? If it's not to much to ask, wrap it in an answer so I can accept it. – CoR May 19 '14 at 09:15

1 Answers1

1

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).

N.B.
  • 13,688
  • 3
  • 45
  • 55
  • There will be one folder called images. Inside will be many num.jpg files. DB id will be that num. I guess I'm fine than. – CoR May 19 '14 at 10:15