Changeset 569701d in github
- Timestamp:
- Mar 17, 2011 10:17:08 AM (2 years ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
- Children:
- a8317ef
- Parents:
- 32b11d3
- File:
-
- 1 edited
-
program/steps/mail/attachments.inc (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
program/steps/mail/attachments.inc
r4591de7 r569701d 84 84 if (is_array($_FILES['_attachments']['tmp_name'])) { 85 85 foreach ($_FILES['_attachments']['tmp_name'] as $i => $filepath) { 86 $attachment = array( 87 'path' => $filepath, 88 'size' => $_FILES['_attachments']['size'][$i], 89 'name' => $_FILES['_attachments']['name'][$i], 90 'mimetype' => rc_mime_content_type($filepath, $_FILES['_attachments']['name'][$i], $_FILES['_attachments']['type'][$i]), 91 'group' => $COMPOSE_ID, 92 ); 86 // Process uploaded attachment if there is no error 87 $err = $_FILES['_attachments']['error'][$i]; 93 88 94 $attachment = $RCMAIL->plugins->exec_hook('attachment_upload', $attachment); 89 if (!$err) { 90 $attachment = array( 91 'path' => $filepath, 92 'size' => $_FILES['_attachments']['size'][$i], 93 'name' => $_FILES['_attachments']['name'][$i], 94 'mimetype' => rc_mime_content_type($filepath, $_FILES['_attachments']['name'][$i], $_FILES['_attachments']['type'][$i]), 95 'group' => $COMPOSE_ID, 96 ); 95 97 96 if ($attachment['status'] && !$attachment['abort']) { 98 $attachment = $RCMAIL->plugins->exec_hook('attachment_upload', $attachment); 99 } 100 101 if (!$err && $attachment['status'] && !$attachment['abort']) { 97 102 $id = $attachment['id']; 98 103 99 104 // store new attachment in session 100 105 unset($attachment['status'], $attachment['abort']); 101 106 $_SESSION['compose']['attachments'][$id] = $attachment; 102 107 103 108 if (($icon = $_SESSION['compose']['deleteicon']) && is_file($icon)) { 104 109 $button = html::img(array( … … 118 123 119 124 $content .= Q($attachment['name']); 120 125 121 126 $OUTPUT->command('add2attachment_list', "rcmfile$id", array( 122 127 'html' => $content, … … 126 131 } 127 132 else { // upload failed 128 $err = $_FILES['_attachments']['error'][$i];129 133 if ($err == UPLOAD_ERR_INI_SIZE || $err == UPLOAD_ERR_FORM_SIZE) { 130 134 $msg = rcube_label(array('name' => 'filesizeerror', 'vars' => array('size' => show_bytes(parse_bytes(ini_get('upload_max_filesize')))))); … … 136 140 $msg = rcube_label('fileuploaderror'); 137 141 } 138 142 139 143 $OUTPUT->command('display_message', $msg, 'error'); 140 144 $OUTPUT->command('remove_from_attachment_list', $uploadid);
Note: See TracChangeset
for help on using the changeset viewer.
