diff options
author | Thomas Bruederli <thomas@roundcube.net> | 2012-11-27 16:22:49 +0100 |
---|---|---|
committer | Thomas Bruederli <thomas@roundcube.net> | 2012-11-27 16:22:49 +0100 |
commit | dff2c713fbc5dd8a501a31f3c158b8be412f46d0 (patch) | |
tree | da0e7fc83ee07c25858122669bbcd3d40c305b28 /program/lib/Roundcube/rcube_message.php | |
parent | 0a83971d3e6bc5dae958e304bea4bb1e7a33db59 (diff) |
Add argument to fetch message parts only partially. Can be used for content mimetype detection without loading the entire file
Diffstat (limited to 'program/lib/Roundcube/rcube_message.php')
-rw-r--r-- | program/lib/Roundcube/rcube_message.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/program/lib/Roundcube/rcube_message.php b/program/lib/Roundcube/rcube_message.php index 87319f04f..4ef534a0a 100644 --- a/program/lib/Roundcube/rcube_message.php +++ b/program/lib/Roundcube/rcube_message.php @@ -173,10 +173,11 @@ class rcube_message * @param string $mime_id Part MIME-ID * @param resource $fp File pointer to save the message part * @param boolean $skip_charset_conv Disables charset conversion + * @param int $max_bytes Only read this number of bytes * * @return string Part content */ - public function get_part_content($mime_id, $fp = null, $skip_charset_conv = false) + public function get_part_content($mime_id, $fp = null, $skip_charset_conv = false, $max_bytes = 0) { if ($part = $this->mime_parts[$mime_id]) { // stored in message structure (winmail/inline-uuencode) @@ -190,7 +191,7 @@ class rcube_message // get from IMAP $this->storage->set_folder($this->folder); - return $this->storage->get_message_part($this->uid, $mime_id, $part, NULL, $fp, $skip_charset_conv); + return $this->storage->get_message_part($this->uid, $mime_id, $part, NULL, $fp, $skip_charset_conv, $max_bytes); } } |