Tips for managing a large number of files?

后端 未结 6 1847
走了就别回头了
走了就别回头了 2020-12-13 21:45

There are some very good questions here on SO about file management and storing within a large project.

Storing Images in DB - Yea or Nay?
Would

6条回答
  •  -上瘾入骨i
    2020-12-13 22:08

    In order to avoid creating an excessive number of entries in a single directory, you may want to base creating directories on pieces of the filename. So for instance, if you have a file named d7f5ae9b7c5a.png, you may want to store it in media/d7/f5/d7f5ae9b7c5a.png. If your filenames are all hexadecimal then this will restrict the number of entries in a single directory to 256 up until the final level.

提交回复
热议问题