Hey there - I work for the Electronic Frontier Foundation (EFF), and we are migrating our huge old legacy site into Drupal. We are trying to get some help developing some additions to the file upload module, and Zack suggested I post our specs here for feedback from you all.
Here's the email I sent him with the specs of our dream file upload module:
EFF needs a file upload and organization module that interacts with files stored on the filesystem. There are some contributed modules with similar functionality, but none that do exactly what we need. It's my belief that adding functionality to the existing 'upload' module that comes with Drupal would be a fine approach.
We have legal case pages which often contain upwards of 50 legal documents in PDF format, organized in different ways. Sometimes by date, but more often by case or by type of document. For some examples:
http://eff.org/legal/cases/att
http://eff.org/Activism/E-voting
Here are some specs for the module I envision to manage these files:
- Document categories/headers
In the file upload area of any node, in an interface not unlike the taxonomy vocabulary setup interface, users should be able to specify a header for a number of documents in a list. Some example headers would be "Motion to Dismiss" or "Injunction" or "Notes from Special Meeting."
Nested categories would be extremely useful, but not required in the first revision.
Headers should be typed freely into a text box, and the list of headers to choose from should be in a pulldown menu.
Only some user roles should be allowed to specify headers, but any user with access to the upload module should be able to choose from a header.
- Document locations on the server
Currently, the Upload module puts uploaded files into a simple directory at /files. In the EFF Drupal setup, we've edited the rewrite rules so that we may serve flat files (such as .txt, .pdf, or images) on the filesystem, while simultaneously serving Drupal pages at the same path. For example, we have a directory called /sony on the filesystem, and a page node in Drupal that has /sony as its URL path.
The file organization module should gather information from the URL path setting for the node, and default to uploading the file into the corresponding directory on the filesystem. If a user is editing the Sony page, and attaches a file, the file should automatically be uploaded into the /sony/ directory on the filesystem.
This default setting should be displayed in a text field in the upload interface, with the option to edit based on user roles. Some user roles should be able to edit the upload directory, some not.
- Uploading Documents
Users should be able to upload a single document from their local machine, as the upload module allows now, and add a title.
Users should be able to upload multiple files into a specific category, in the interface that is best for this. My inclination would be to allow users to upload a .zip or .tar, though this has security implications, so maybe there is a better way.
In an instance wherein a user uploads numerous documents, they should be able to add titles for them after the fact.
- Displaying Documents
On the site, files should be displayed as they are now, with title or filename, and size.
A "very nice to have" feature would be if files could be sorted by date or category.
- Automatically seeing files on the filesystem
Because we are moving many PDFs over from flat storage, it would be amazingly wonderful if this module could "see" files which exist in the corresponding directories on the filesystem. This idea is not well thought out right now, but presumbably only files certain specified extensions would appear in the upload interface automatically, and then be able to have titles assigned to them.

Comments
correct me if I'm wrong
Do I get it right?
Essentially what you are looking for is how to cache an existing filesystem into the drupal db and possibly what do you need to add to the drupal db to be able to do that.
the fundamenal question is how do you want to reflect a file in drupal
- attachment to a document, but what is the containing document - a summary of the pdf or something similar, a directory, ....
- a node with auto generated stuff
- something else
then how do you reflect a directory from the filesystem into Drupal
- taxonomy
- a node hirarchy, similar to books
- something else
Of course, there are the questions arising from recognising the local file and directory naming convetions, etc... But that should be the least of your worries.
I have done something in the past, without the filesystem stuff, to display a taxonomy as a filesystem hierarchy. These days you could possibly use the category module as well, depending on stability. My problems were/are, (come from) what do the users expect from a file or a directory, how should the system behave. Unfortunately their expectations are not met yet :) So I can't give a recipe, but I'm working on it.
I am working on almost the exact same thing ....
This is our ezdownload module in action ... I am currently working on update this module for 4.7. The file behavoir you are refering is very similar to some functionality I am going to add to this module. Basically the way I would like it to work, is that an admin specifies a root direction on an admin page. The module will then read the root directory and all of it's children directories and file, and create records in the node, files, and leaf tables (Leaf is this module's) .... The viewing of the page will be gathered from the records in the database.
Another improvement I would like to make is to remove the dependancy on the upload module. Is it possible to store some sort of file point in the database?
I think the three of us should try to collaberate on this and create a beast of a file system / download module. I am going to pass the spec by my boss and see if he's on board
Me too...
That's interesting, since I have developed something similar to manage file attachments. My current contract requires a site which displays a large number of forms and files. I wanted the ability to automatically create nodes based on these files (so that comments/announcements can be made on them, etc) and was a bit unhappy with the prospect of managing large lists of files/directories manually. Not to mention the headache I got trying to figure out how to read files from windows shares scattered around the network.
Also I was a bit uncomfortable with some of the behaviour of the upload module - besides storing everything in /files, when a node is deleted, all of its associated files are deleted as well.
So I built a module to do it, called 'filetank'. It parses a specified directory on the network for files and stores the info in a database table. A table of files is presented in the configuration section. Selecting the checkbox next to the filename will create a node which has that file as an attachment (not an upload module attachment, though it displays exactly the same) and which is displayed in that filetank's block output. The file's node can be edited, commented, deleted, without affecting the file itself.
The code is pretty messy at the moment (my first drupal module) and I make no claims as to security (this is a secured corporate intranet), but it does the trick, and could be pretty easily expanded to do all kinds of things. if anyone is interested i could pass it along...
Just in case you see this..
I would like to see your "Filetank" module.