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);
107 $max_filesize = self::getMaxFileSize();
110 return sprintf(
"%.1f MB", $max_filesize / 1024 / 1024);
static getMaxFileSizeString()
Gets the maximum upload file size allowed as string (like '14.2 MB').
static getMaxFileSize()
Gets the maximum upload file size allowed in bytes.
static isRepositoryDragAndDropUploadEnabled()
Gets whether drag and drop file upload in the repository is enabled.
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
static isUploadSupported()
Determines whether file upload is supported at the current location.
static isUploadAllowed($a_ref_id, $a_type="")
Determines whether files can be uploaded to the object with the specified reference id...
static isDragAndDropUploadEnabled()
Gets whether drag and drop file upload is enabled.