diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2012-04-13 08:52:02 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2012-04-13 08:52:02 +0000 |
| commit | d61fd77d83926d892645a15e00c3443d2a8a6368 (patch) | |
| tree | 83ede4b27294a42a45ee988751f51182994e0de7 /roundcubemail/program/steps/mail/compose.inc | |
| parent | 8a3df3f032059464ebaab2dde26ab0d24b186572 (diff) | |
- Merge devel-framework branch, resolved conflicts
git-svn-id: https://svn.roundcube.net/trunk@6073 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/steps/mail/compose.inc')
| -rw-r--r-- | roundcubemail/program/steps/mail/compose.inc | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/roundcubemail/program/steps/mail/compose.inc b/roundcubemail/program/steps/mail/compose.inc index ebf79be4e..c0a5bf7bc 100644 --- a/roundcubemail/program/steps/mail/compose.inc +++ b/roundcubemail/program/steps/mail/compose.inc @@ -1162,10 +1162,22 @@ function rcmail_save_attachment(&$message, $pid) $data = $message->get_part_content($pid); } + $mimetype = $part->ctype_primary . '/' . $part->ctype_secondary; + $filename = $part->filename; + if (!strlen($filename)) { + if ($mimetype == 'text/html') { + $filename = rcube_label('htmlmessage'); + } + else { + $filename = 'Part_'.$pid; + } + $filename .= '.' . $part->ctype_secondary; + } + $attachment = array( 'group' => $COMPOSE['id'], - 'name' => $part->filename ? $part->filename : 'Part_'.$pid.'.'.$part->ctype_secondary, - 'mimetype' => $part->ctype_primary . '/' . $part->ctype_secondary, + 'name' => $filename, + 'mimetype' => $mimetype, 'content_id' => $part->content_id, 'data' => $data, 'path' => $path, |
