download_href()
upload()
filestore_path()
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.
download_href()
Returns HREF to download the attachment.
Optionsl parameters are passed to download.htm. Some useful
download => 1 force 'downloading' the file instead of open it in browser
upload()
Upload a file from client and store it. Returns true is upload was successful.
Throws ePortal::Exception::DataNotValid
if upload is impossible.
Make a link between the attachment and some ThePersistent object. Also mark the attachment as complete.
filestore_path()
Returns path to directory like
/$comproot/attachment/1/0
Read the content of attachment from FH and create a number of chunks as needed
Low level functions for content retrieval chunk by chunk.
Returns undef
when no chunks to retrieve
$att->get_first_chunk; while(my $buffer = $att->get_next_chunk) { # do comthing with $buffer }
Sergey Rusakov, <rusakov_sa@users.sourceforge.net>