CGI-Uploader
view release on metacpan or search on metacpan
lib/CGI/Uploader/Cookbook.pod view on Meta::CPAN
=head1 NAME
CGI::Uploader::Cookbook - Examples of CGI::Uploader usage
=head1 Description
C<CGI::Uploader::Cookbook> is a tutorial that accompanies the B<CGI::Uploader>
distribution. It shows example syntax for common uses.
C<CGI::Uploader> module is designed to help with the task of managing files
uploaded through a CGI application. The files are stored on the file system,
and the file attributes stored in a SQL database.
=head1 Introduction to CGI::Uploader
=head2 A Little History
The release of this module represents a culmination of seven years of experience
managing file uploads as a professional website developer for
Summersault, LLC (L<http://www.summersault.com/>). Over that time I noticed patterns
that were re-usable from project to project. I went through several versions
and rewrites of modules that attempted to be 'generic' and not need
modification when the next project came along. With CGI::Uploader, I believe I
finally have a solution that I will continue to be happy with and I think others
will be find generally useful. Enjoy!
=head2 Freedom of Choice
I endeavored to make CGI::Uploader to work within a variety of system designs.
It offers you freedom choice in the following areas:
=over
=item * Database Choice
MySQL and Postgres are supported directly. The SQL used is very simple-- support
for additional databases should be trivial.
=item * Choice of Query Provider
The query object used may provided by C<CGI.pm>, C<CGI::Simple> or
C<Apache::Request>. Another source could be used by overriding the C<upload>
method.
=item * File Storage Schemes for Large and Small Projects
For small projects, all uploads can be stored in a single directory. For large
projects, we provide the C<md5> file scheme, which should scale well to
millions of images, without burdening any single directory with storing too
many of them.
=item * Choice of Data Display
Because the meta data is stored in a straightforward SQL database table, you
can retrieve your data and display in any number of custom ways. Several functions
are also built in to help with common display tasks. The C<build_loc()> method is
used to construct the file system or URL path of an image, given it's ID and extension.
C<fk_meta()> provides an easy way to get the meta data of an upload by relating it to a foreign
key in another table.
Finally, C<transform_meta()> is a basic function which transforms a hashref of data from the database
into a format more useful for display, producing a hash that looks like this:
{
my_custom_prefix_id => 523,
( run in 0.681 second using v1.01-cache-2.11-cpan-39bf76dae61 )