public function uploadFile() { if (strlen(trim($_FILES['userfile']['name']))) { if ($this->mfile->storeUploadedFile($_FILES['userfile']) == 1) { ilUtil::sendFailure($this->lng->txt('mail_maxsize_attachment_error') . ' ' . ilFormat::formatSize($this->mfile->getUploadLimit())); } } $this->showAttachments(); }
public function uploadFile() { /** * @var $lng ilLanguage */ global $lng; if (strlen(trim($_FILES['userfile']['name']))) { $form = $this->getToolbarForm(); if ($form->checkInput()) { $this->mfile->storeUploadedFile($_FILES['userfile']); ilUtil::sendSuccess($lng->txt('saved_successfully')); } else { if ($form->getItemByPostVar('userfile')->getAlert() != $lng->txt("form_msg_file_size_exceeds")) { ilUtil::sendFailure($form->getItemByPostVar('userfile')->getAlert()); } else { ilUtil::sendFailure($this->lng->txt('mail_maxsize_attachment_error') . ' ' . ilFormat::formatSize($this->mfile->getUploadLimit())); } } } else { ilUtil::sendFailure($this->lng->txt('mail_select_one_file')); } $this->showAttachments(); }