diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-02-09 13:10:12 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-02-09 13:10:12 +0000 |
| commit | 7d6aefc45cb269b327f058bea54bf1136cf95b00 (patch) | |
| tree | 95006358696d8e68263431c35f6c31eff94a8148 /roundcubemail/program/steps/mail/attachments.inc | |
| parent | e9fdb4bae6ee01bae196782932b43caa65e8f48f (diff) | |
- Fix attachment excessive memory use, support messages of any size (#1484660)
git-svn-id: https://svn.roundcube.net/trunk@3261 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/steps/mail/attachments.inc')
| -rw-r--r-- | roundcubemail/program/steps/mail/attachments.inc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/roundcubemail/program/steps/mail/attachments.inc b/roundcubemail/program/steps/mail/attachments.inc index d0808d080..2b4a59024 100644 --- a/roundcubemail/program/steps/mail/attachments.inc +++ b/roundcubemail/program/steps/mail/attachments.inc @@ -53,9 +53,11 @@ if ($RCMAIL->action=='display-attachment') $attachment = $RCMAIL->plugins->exec_hook('display_attachment', $attachment); if ($attachment['status']) { - $size = $attachment['data'] ? strlen($attachment['data']) : @filesize($attachment['path']); + if (empty($attachment['size'])) + $attachment['size'] = $attachment['data'] ? strlen($attachment['data']) : @filesize($attachment['path']); + header('Content-Type: ' . $attachment['mimetype']); - header('Content-Length: ' . $size); + header('Content-Length: ' . $attachment['size']); if ($attachment['data']) echo $attachment['data']; @@ -80,6 +82,7 @@ if (is_array($_FILES['_attachments']['tmp_name'])) { foreach ($_FILES['_attachments']['tmp_name'] as $i => $filepath) { $attachment = array( 'path' => $filepath, + 'size' => $_FILES['_attachments']['size'][$i], 'name' => $_FILES['_attachments']['name'][$i], 'mimetype' => rc_mime_content_type($filepath, $_FILES['_attachments']['name'][$i], $_FILES['_attachments']['type'][$i]) ); |
