28 $rbacsystem =
$DIC[
'rbacsystem'];
35 $upload_dir =
$lm_set->get(
"cont_upload_dir");
40 }
catch (InvalidArgumentException) {
43 return $scorm_import_directory->getAbsolutePath();
51 if ($upload_dir = self::_getUploadDirectory() ===
'' || $upload_dir = self::_getUploadDirectory() ===
'0') {
56 $handle = opendir($upload_dir);
58 while (
false !== ($file = readdir($handle))) {
59 $full_path = $upload_dir .
"/" . $file;
60 if (is_file($full_path) && is_readable($full_path)) {
74 return in_array($a_file, $files);
77 public static function _copyUploadFile(
string $a_file,
string $a_target,
bool $a_raise_errors =
true): bool
80 $main_tpl =
$DIC->ui()->mainTemplate();
82 $ilias =
$DIC[
'ilias'];
87 if (!is_file($file)) {
88 if ($a_raise_errors) {
89 $ilias->raiseError(
$lng->txt(
"upload_error_file_not_found"), $ilias->error_obj->MESSAGE);
91 $main_tpl->setOnScreenMessage(
'failure',
$lng->txt(
"upload_error_file_not_found"),
true);
99 if ($a_raise_errors) {
101 $lng->txt(
"file_is_infected") .
"<br />" .
103 $ilias->error_obj->MESSAGE
106 $main_tpl->setOnScreenMessage(
'failure',
$lng->txt(
"file_is_infected") .
"<br />" .
112 $main_tpl->setOnScreenMessage(
'info', $vir[1],
true);
114 return copy($file, $a_target);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _copyUploadFile(string $a_file, string $a_target, bool $a_raise_errors=true)
static _checkUploadFile(string $a_file)
static _getUploadDirectory()
static virusHandling(string $a_file, string $a_orig_name='', bool $a_clean=true)