Mobile app version of vmapp.org
Login or Join
Murray432

: Comfortable number of server files in a folder I'm building a website which holds its images in relevant folder, but I was wondering how to structure the folder paths ( month/year/ or just

@Murray432

Posted in: #Directory #Php

I'm building a website which holds its images in relevant folder, but I was wondering how to structure the folder paths ( month/year/ or just year/ )

I will be getting the images via php, so the scripting will look like:

files/cover_photo/$year/$month/$id.jpg

I don't really know how many images I'm going to be posting but was wondering how many images is a comfortable number in each folder if they are going to be selected using the PHP script above.

I don't want to risk slowing my site down by having too many images per directory, but at the same time I don't want to have too many directories with few files inside.

Can anyone give me any advice?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Murray432

1 Comments

Sorted by latest first Latest Oldest Best

 

@Merenda212

There is not really a "right answer" to this.

Sorting by year/month is not a bad option, because it's easy to implement and it scales well.

There's no need to worry about empty directories though - just create the directories when you need them (i.e. the first time there's an upload in that year or month).

This is the way Wordpress does it.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme