ePortal::Attachment - File attachment for any object
ePortal::Attachment is used for manipulating file attachments.
Database store is the only method to store big attachments since ePortal 4.1.
Every attachment is split into several chunks. The size of a chunk is a New chunk tables are created automatically when the size of current table reached 2Gb limit. This method guaranteed that any file of any size can be stored on any OS platform.
File store is deprecated since ePortal 4.1
Content type of a file negotiation is based on Apache internals. During download a subrequest is made to discover a content_type to use. See mod_mime Apache module and mime.types file for details.
mod_mime
mime
types
Upload a file from client and store it. Returns true is upload was successful.
Throws ePortal::Exception::DataNotValid if upload is impossible.
ePortal::Exception::DataNotValid
r
Apache::Request object
Make a link between the attachment and some ThePersistent object. Also mark the attachment as complete.
Returns path to directory like
/$comproot/attachment/1/0
Read the content of attachment from FH and create a number of chunks as needed
fh
Filehandle to read from
Low level functions for content retrieval chunk by chunk.
Returns undef when no chunks to retrieve
undef
$att->get_first_chunk; while(my $buffer = $att->get_next_chunk) { # do comthing with $buffer }
Sergey Rusakov, <rusakov_sa@users.sourceforge.net>
To install ePortal, copy and paste the appropriate command in to your terminal.
cpanm
cpanm ePortal
CPAN shell
perl -MCPAN -e shell install ePortal
For more information on module installation, please visit the detailed CPAN module installation guide.