25 global $objDefinition, $ilAccess;
27 if (self::isUploadSupported())
29 include_once(
"./Services/FileUpload/classes/class.ilFileUploadSettings.php");
38 if ($objDefinition->isContainer($a_type))
39 return $ilAccess->checkAccess(
"create_file",
"", $a_ref_id,
"file");
56 if (strtolower(
$_GET[
"baseClass"]) ==
"ilrepositorygui")
58 $cmd = $ilCtrl->getCmd();
74 $umf = ini_get(
"upload_max_filesize");
76 $pms = ini_get(
"post_max_size");
79 $multiplier_a=array(
"K" => 1024,
"M" => 1024 * 1024,
"G" => 1024 * 1024 * 1024);
81 $umf_parts=preg_split(
"/(\d+)([K|G|M])/", $umf, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);
82 $pms_parts=preg_split(
"/(\d+)([K|G|M])/", $pms, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);
84 if (count($umf_parts) == 2) {
85 $umf = $umf_parts[0]*$multiplier_a[$umf_parts[1]];
87 if (count($pms_parts) == 2) {
88 $pms = $pms_parts[0]*$multiplier_a[$pms_parts[1]];
92 $max_filesize = min($umf, $pms);
95 $max_filesize=max($umf, $pms);
110 return sprintf(
"%.1f MB", $max_filesize / 1024 / 1024);