alecpl
2009-10-03 ebf8726eeaa507096ef28e776303b459c401a924
program/steps/mail/attachments.inc
@@ -74,6 +74,8 @@
// clear all stored output properties (like scripts and env vars)
$OUTPUT->reset();
$uploadid = get_input_value('_uploadid', RCUBE_INPUT_GET);
if (is_array($_FILES['_attachments']['tmp_name'])) {
  foreach ($_FILES['_attachments']['tmp_name'] as $i => $filepath) {
    $attachment = array(
@@ -109,7 +111,7 @@
      $content .= Q($attachment['name']);
      
      $OUTPUT->command('add2attachment_list', "rcmfile$id", $content);
      $OUTPUT->command('add2attachment_list', "rcmfile$id", $content, $uploadid);
    }
    else {  // upload failed
      $err = $_FILES['_attachments']['error'][$i];
@@ -124,6 +126,7 @@
      }
    
      $OUTPUT->command('display_message', $msg, 'error');
      $OUTPUT->command('remove_from_attachment_list', $uploadid);
    }
  }
}
@@ -135,10 +138,10 @@
  else
    $msg = rcube_label('fileuploaderror');
  $OUTPUT->command('display_message', $msg, 'error');
  $OUTPUT->command('remove_from_attachment_list', $uploadid);
}
// send html page with JS calls as response
$OUTPUT->command('show_attachment_form', false);
$OUTPUT->command('auto_save_start', false);
$OUTPUT->send('iframe');