Jump to content

Handling of Uploaded Files


Stryves

Recommended Posts

Heyyas,

 

This is more theory than assistance on code.

 

I have a site where users can upload images, and the filename is randomly generated based on their ID/Datetime to prevent filename duplicates.

 

I've noticed that using 1 directory for this is getting insanely full, over 4,000 images now.

 

I was thinking of using a variable in the path so that after a certain date, all images would go into "/908" which is September 08.

 

Because the path to the folder is included in the DB, it doesn't have any issue's on tracking, but I was curious if this at all matters?

 

Anyone have suggestions of how they handle folders with images over 5,000 ? Or just don't look at that folder?  :P

Link to comment
https://forums.phpfreaks.com/topic/124679-handling-of-uploaded-files/
Share on other sites

I would suggest storing all the images in a directory with that month, like your "/0908/" directory that you mentioned. Then your code could just use the date to determine which folder it's in. Then you never loose track of where something is, and your folders will never get too big.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.