Hi Mark,

Taking a scan though this. The first issue concerns how the documentation is is put forth. It's not quickly clear to me what the module does. At first glance I thought "CGI::UploadDB - Manage CGI uploads using SQL database" meant is was a module for automatically uploading/replicating database tables from one database to a remote database on your web site via CGI (probably because I recently wrote that). The word "manage" itself in imprecise, especially when "using SQL database" could modify either "CGI uploads" or the "management of CGI uploads."

On reading the description, it seems to be a module for a web-accessible file system, where file data is stored in a real file system and file meta data is stored in a database for easy searching. This seems widely useful as an alternative to FTP, kind-of like a much trimmed down version of Zope for Perl (i.e. Pope). However, the module does only the data processing and CGI request handling parts this and does not create the UI/HTML--this context in which it is used can be stated as well.

So, the next question concerns how to upload a file. One apparently uses the install_uploads method, passing it a Data::FormValidator::Results object, but what CGI request parameters must be sent? What would the HTML form look like? I'm expecting something like

<form method="post" enctype="multipart/form-data" action="...">
  <input type="file" name="something" > ...
</form>

possibly even in the SYNOPSIS and expecting some code like

 $fh = $query->upload('something');
 while (<$fh>) { ... }

in the module itself. However from the code, there seems to be a temporary file that must be created:

  copy($q->tmpFileName($q->param($i)),
        $self->{updir_path}."/$id".$info->{extension})

In fact, I've never seen this CGI::tmpFileName method before. I first thought this was requiring a temporary file upload via FTP or something. tmpFileName is partly documented in CGI::Simple but is also undocumented but existant in CGI.pm. So, the fact that the module uses some directory to store temporary files should be stated as well.

At first I was confused about the deal with the thumbnails. How are thumbnails used and accessed? Are they displayed (no) or merely stored (yes)? Are thumbnails like buttons or icons (associated with file types) or snapshots associates with individual images? The latter seems the case now, but it unclear until I got to the METHODS section where it says "thumbnails that will be created for these files (if they are images)" since I was thinking about non-image types of files (text files, Perl files, *.gz.bz2.tar.gpg.md5 files, etc...). Can there be multiple thumbnails per file? Can a single thumbnail be associated with multiple files? Is a thumbnail deleted when a file associated with it is deleted? The first part of the DESCRIPTION section is good in that it starts defining what the data model is and what the database and file system requirements are, but nowhere is this done fully. You could say somewhere something like, "You must have available a web-accessible directory ona POSIX-compatible file system with such-and-such file permissions and sufficient free space to hold file uploads. Changes to that directory will be managed entirely via CGI::UploadDB. There must also be a temporary directory with such and such permissions capable of holding at least one concurrent file upload.... Uploaded files can be binary or ASCII handled as such and such, and each file can have user-supplied/inferred metadata associated with it: (if applicable) zero or more image thumbnails rendered automatically by CGI::UploadDB based on mime-type/file-extension, a file ID, .... File names are not stored. Custom metadata attributes are/are-not supported via such and such. Your code own must generate HTML forms with ...such and such... parameters that will form the requests handled by CGI::UploadDB...etc. etc. etc.."

OK, so once you upload a file, and you know the filename, how do you find it? The uploads table has "id" and "[file]extension" fields but no file name field. On further look, it seems that files are referenced purely by numeric ID as clarified near the end of the document where it says

        {
                file_1_id     => 523,
                file_1_url    => 'http://localhost/images/uploads/523.pdf',
        }

Some other terminology like "installs all the files on the file system" can be misleading. When I hear "install," I think "make install" as in "upload a *.tar.gz file and install it" or "Add it to the system PATH," which some users may enjoy doing :)

So, that was my first impression, hopefully useful.

-davidm


Mark Stosberg wrote:
Hello, I'm interested in feedback on a module I've developed to manage file uploads, which I'm calling CGI::UploadDB for now. CGI::UploadDB manages file uploads with a SQL database. It handles generating
thumbnails, file installation, deletion, and display. Files are stored on the file system with meta-data in the database. MySQL and
Postgres are supported.
I'm interested to know: OK Name? Useful idea? Useful interface? Clear documentation?
Other suggestions? Full documentation [1] and source code [2] are available. It currently depends
on the brand new Data::FormValidator 3.50 release. 1. http://mark.stosberg.com/dfv/doc/CGI/UploadDB.html 2. http://mark.stosberg.com/perl/CGI-UploadDB-0.10_03.tar.gz 3. http://search.cpan.org/perldoc?Data::FormValidator


Thanks!

Mark

--
. . . . . . . . . . . . . . . . . . . . . . . . . . . Mark Stosberg Principal Developer [EMAIL PROTECTED] Summersault, LLC 765-939-9301 ext 202 database driven websites
. . . . . http://www.summersault.com/ . . . . . . . .






Reply via email to