Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

dbix::class::inflatecolumn::file(3pm) [debian man page]

DBIx::Class::InflateColumn::File(3pm)			User Contributed Perl Documentation		     DBIx::Class::InflateColumn::File(3pm)

NAME
DBIx::Class::InflateColumn::File - DEPRECATED (superseded by DBIx::Class::InflateColumn::FS) Deprecation Notice This component has a number of architectural deficiencies that can quickly drive your filesystem and database out of sync and is not recommended for further use. It will be retained for backwards compatibility, but no new functionality patches will be accepted. Please consider using the much more mature and actively supported DBIx::Class::InflateColumn::FS. You can set the environment variable DBIC_IC_FILE_NOWARN to a true value to disable this warning. SYNOPSIS
In your DBIx::Class table class: use base 'DBIx::Class::Core'; __PACKAGE__->load_components(qw/InflateColumn::File/); # define your columns __PACKAGE__->add_columns( "id", { data_type => "integer", is_auto_increment => 1, is_nullable => 0, size => 4, }, "filename", { data_type => "varchar", is_file_column => 1, file_column_path =>'/tmp/uploaded_files', # or for a Catalyst application # file_column_path => MyApp->path_to('root','static','files'), default_value => undef, is_nullable => 1, size => 255, }, ); In your Catalyst::Controller class: FileColumn requires a hash that contains IO::File as handle and the file's name as name. my $entry = $c->model('MyAppDB::Articles')->create({ subject => 'blah', filename => { handle => $c->req->upload('myupload')->fh, filename => $c->req->upload('myupload')->basename }, body => '....' }); $c->stash->{entry}=$entry; And Place the following in your TT template Article Subject: [% entry.subject %] Uploaded File: <a href="/static/files/[% entry.id %]/[% entry.filename.filename %]">File</a> Body: [% entry.body %] The file will be stored on the filesystem for later retrieval. Calling delete on your resultset will delete the file from the filesystem. Retrevial of the record automatically inflates the column back to the set hash with the IO::File handle and filename. DESCRIPTION
InflateColumn::File METHODS
_file_column_callback ($file,$ret,$target) Method made to be overridden for callback purposes. AUTHOR
Victor Igumnov LICENSE
This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2011-05-10 DBIx::Class::InflateColumn::File(3pm)

Check Out this Related Man Page

DBIx::Class::Manual::DocMap(3pm)			User Contributed Perl Documentation			  DBIx::Class::Manual::DocMap(3pm)

NAME
DBIx::Class::Manual::DocMap - What documentation do we have? Manuals DBIx::Class::Manual - User's Manual overview. DBIx::Class::Manual::FAQ - Frequently Asked Questions, gathered from IRC and the mailing list. DBIx::Class::Manual::Intro - Introduction to setting up and using DBIx::Class. DBIx::Class::Manual::Example - Full example Schema. DBIx::Class::Manual::Cookbook - Various short recipes on how to do things. DBIx::Class::Manual::Troubleshooting - What to do if things go wrong (diagnostics of known error messages). DBIx::Class::Manual::Component - How to write your own DBIx::Class components. DBIx::Class::Manual::Glossary - What do all those terms mean? Setting up DBIx::Class::Schema - Overall schemas, and connection container. DBIx::Class::ResultSource - Source/Table definition functions. DBIx::Class::Relationship - Simple relationships. DBIx::Class::Relationship::Base - Relationship details. DBIx::Class::PK::Auto - Magically retrieve auto-incrementing fields. DBIx::Class::Core - Set of standard components to load. DBIx::Class::InflateColumn - Making objects out of your columns. DBIx::Class::InflateColumn::DateTime - Magically turn your datetime or timestamp columns into DateTime objects. DBIx::Class::PK - Dealing with primary keys. DBIx::Class::ResultSourceProxy::Table - Turns the resultsource into a table. DBIx::Class::AccessorGroup - Accessor grouping. Retrieving and creating data DBIx::Class::ResultSet - Selecting and manipulating sets. DBIx::Class::ResultSetColumn - Perform operations on entire columns of a ResultSet. DBIx::Class::Row - Dealing with actual data. DBIx::Class::Storage - Basic Storage stuff. DBIx::Class::Storage::DBI - Storage using DBI and SQL::Abstract. perl v5.14.2 2010-06-03 DBIx::Class::Manual::DocMap(3pm)
Man Page