[Catalyst] Simple blob upload example?
jshirley at gmail.com
Fri Sep 19 16:52:53 BST 2008
On Fri, Sep 19, 2008 at 7:40 AM, Dr. Jennifer Nussbaum
<bg271828 at yahoo.com> wrote:
> Im about to start an app where i'll need to upload PDFs from a user and store them in my database. Is there any quick example that might show
> how to do this? I browsed through the wiki and didnt see anything. I know its simple but ive never done this before.
To divert this a bit, are you -really- sure you want to store them in
a database? Storing large files in a database is not going to be
ideal, as you'll lose abilities to replicate the files in a separate
policy from you DB, etc.
I really like MogileFS for storing files, and it really is easy enough
to setup on a single host and get going... then from there, it's as
$mogilefs->store_file( $key, $class, $upload->tempfile );
But to answer your question, the uploads are this object:
You can then just do $db_record->contents( $upload->slurp );
More information about the Catalyst