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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Derik

    #1

    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
  • Jerry Stuckle

    #2
    Re: user uploaded files -- max # of files per directory?

    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.
    jstucklex@attgl obal.net
    =============== ===

    Comment

    • Norman Peelman

      #3
      Re: user uploaded files -- max # of files per directory?

      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?-

      Comment

      Working...