473,326 Members | 2,127 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

user uploaded files -- max # of files per directory?

I believe there's some upper limit to the number of files permitted in
a directory on many web servers (and a corresponding performance hit
as the numbers get large?)

I'm doing an application where users are allowed to upload files
(PDF's, images) and there is a nonzero possibility that the quantities
involved could get that large, so I'm reluctant to just consign
everything to a common /uploads/ directory

Is there a, um... strategy? A best practice for this? I see these
forking upload directories with folders that are long numbers a lot-
but I'm not clear on the mechanism involved. Do the numbers represent
some sort of system? When 'seeking' a file, how does the script know
which sub-directory (or sub-sub directory) it's buried under?

....help? I'm all dizzy and turned around! Could someone point me in
the right direction and give me a gentle push and a kind word of
advice?

-Derik
Jun 2 '08 #1
2 1353
Derik wrote:
I believe there's some upper limit to the number of files permitted in
a directory on many web servers (and a corresponding performance hit
as the numbers get large?)

I'm doing an application where users are allowed to upload files
(PDF's, images) and there is a nonzero possibility that the quantities
involved could get that large, so I'm reluctant to just consign
everything to a common /uploads/ directory

Is there a, um... strategy? A best practice for this? I see these
forking upload directories with folders that are long numbers a lot-
but I'm not clear on the mechanism involved. Do the numbers represent
some sort of system? When 'seeking' a file, how does the script know
which sub-directory (or sub-sub directory) it's buried under?

...help? I'm all dizzy and turned around! Could someone point me in
the right direction and give me a gentle push and a kind word of
advice?

-Derik
There's generally no "hard" limit - but at some point it becomes a bit
impractical - i.e. 100K files in one directory will take a while for the
system to sort out.

You can put them in different directories. Some use the first two
characters to define the directory, i.e. "myfile.pdf" might be in
/m/y/myfile.pdf or /my/myfile.pdf.

You can also investigate database. I keep a lot of files in a database;
although some people will tell you it doesn't work, I've been doing it
for over 20 years and it works great. You just need to design the
database properly.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jun 2 '08 #2
Derik wrote:
I believe there's some upper limit to the number of files permitted in
a directory on many web servers (and a corresponding performance hit
as the numbers get large?)

I'm doing an application where users are allowed to upload files
(PDF's, images) and there is a nonzero possibility that the quantities
involved could get that large, so I'm reluctant to just consign
everything to a common /uploads/ directory

Is there a, um... strategy? A best practice for this? I see these
forking upload directories with folders that are long numbers a lot-
but I'm not clear on the mechanism involved. Do the numbers represent
some sort of system? When 'seeking' a file, how does the script know
which sub-directory (or sub-sub directory) it's buried under?

...help? I'm all dizzy and turned around! Could someone point me in
the right direction and give me a gentle push and a kind word of
advice?

-Derik
You can alphabetize the directories by the names of the files or
something similar... or you could store them as binary data in a
database and let the database do the heavy lifting.

--
Norman
Registered Linux user #461062
-Have you been to www.php.net yet?-
Jun 2 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Andrea Stein | last post by:
hi, i've a problem to zip files which are uploaded to the server. (include the class zip.lib.php from phpMyAdmin) require("inc/zip.lib.php"); $zipfile = new zipfile(); //add the uploaded file...
3
by: dan glenn | last post by:
(PHP 4.3.4) THIS IS DRIVING ME NUTS! I have a website where I offer members their own bit of webspace to use and am coding a very simple 'filemanager' that allows a user to upload, delete, and...
18
by: Dino | last post by:
dear all, i've created an application for a customer where the customer can upload ..csv-files into a specified ftp-directory. on the server, a php-script, triggered by a cronjob, reads all the...
0
by: Edward Low | last post by:
Hi, How should i allow user to upload multiple files in a page and display message on the page to inform the client the file is being uploading while the upload process still in progress? for...
6
by: Kimmo Laine | last post by:
Running IIS 6 on Windows 2003 server. After an update to the most recent version of php 5.1.2, for some reacon a function handling uploaded files using is_file stopped working. is_file failed...
5
by: cmk128 | last post by:
Hi I have built a free-php-space website, after the user is registered, he will have 100MB php space. the server is linux+apache. The location of the user's file is in: /phpspace/<username> ...
0
by: xolaks | last post by:
Salutations! I'm currently developing a page that is allowing many users to upload and download their files. But the probability of big amount on requests drives me to think how to handle files with...
6
by: Reggie | last post by:
am trying to associate username with filename in a upload script. I get this error: Parse error: syntax error, unexpected T_STRING in /home/fhlinux169/c/ clashoff.co.uk/user/htdocs/upload.php...
14
by: Jeigh | last post by:
Hello, I'm going to start making a script that will allow users to upload a file, then re download it later. I'll basically be doing the following: - The uploaded file will be given a string of...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.