Page 1 of 1
Too many pictures in a folder.
Posted: Wed Dec 01, 2004 12:36 pm
by PanK
I have a website running on Apache. There is a limit on the files in folder - 32000. i have 29000 so far. What is the best way to deal with it?
And does anybody know how to manage BLOB?
Thank you.
Posted: Wed Dec 01, 2004 2:06 pm
by josh
Use a database.... just create a blob field and then when inserting a file go:
$data=file_get_contents($tmpfile);
$data=strip_slashes($data);
INSERT INTO `files` (`data`) VALUES ('$data')
Get it?
Posted: Wed Dec 01, 2004 2:11 pm
by kettle_drum
You could either put them into a database or simply split the images into more folders - it sounds like you add a lot of photos on a regular basis, so why not have a new folder for each month or week.
Posted: Wed Dec 01, 2004 2:28 pm
by PanK
Thanx, I've decided to store pictures in Data Base using BLOB. Thought about different folders. Not going to work.
Posted: Wed Dec 01, 2004 5:23 pm
by josh
My philosophy:
Anytime you have more then 50 things to store use a database rather then useing any type of files or anything, just because databases are easier to manage and search for things.
Posted: Wed Dec 01, 2004 5:43 pm
by pickle
Just a note: In my experience, storing images in a database, while handy, will increase the time it takes for a client to fully download the image. It takes longer to pull the data out of the db and send it to the browser, than it does to just send the file location to the browser. I'm not saying using a DB is a bad idea, in fact it sounds like the best possible idea, but just a warning that page load times will increase.