19 declare(strict_types=1);
73 $this->resource = $input;
74 $this->path_to_file = $input->getMetadata(
'uri');
75 } elseif ($input === self::DIRECT_PHP_OUTPUT) {
92 if (!$this->
delivery()->supportsStreaming()) {
112 !$this->
delivery()->doesFileExists($this->path_to_file)
113 && $this->path_to_file !== self::DIRECT_PHP_OUTPUT
117 $this->
http->sendResponse();
181 $this->
http->close();
193 $finfo = finfo_open(FILEINFO_MIME_TYPE);
215 if (self::$delivery_type_static) {
221 if (function_exists(
'apache_get_modules')
222 && in_array(
'mod_xsendfile', apache_get_modules(),
true)
227 if (is_file(
'./Services/FileDelivery/classes/override.php')) {
228 $override_delivery_type =
false;
230 require_once(
'./Services/FileDelivery/classes/override.php');
231 if ($override_delivery_type) {
236 if ((!$ilRuntime->isFPM() && !$ilRuntime->isHHVM())
458 $ob_get_contents = ob_get_contents();
459 if ($ob_get_contents) {
509 foreach ($umlaut_mapping as $src => $tgt) {
510 $original_filename = str_replace($src, $tgt, $original_filename);
513 $ascii_filename = htmlentities($original_filename, ENT_NOQUOTES,
'UTF-8');
514 $ascii_filename = preg_replace(
'/\&(.)[^;]*;/',
'\\1', $ascii_filename);
515 $ascii_filename = preg_replace(
'/[\x7f-\xff]/',
'_', $ascii_filename);
518 $ascii_filename = preg_replace(
519 '/[:\x5c\/\*\?\"<>\|]/',
523 return $ascii_filename;
static returnASCIIFileName(string $original_filename)
Converts a UTF-8 filename to ASCII.
setConvertFileNameToAsci(bool $convert_file_name_to_asci)
setDeleteFile(bool $delete_file)
setMimeType(string $mime_type)
FileDeliveryTypeFactory $factory
static string $delivery_type_static
setHasContext(bool $has_context)
__construct($input, Services $http)
Class ChatMainBarProvider .
Class FileDeliveryTypeFactory.
static lookupMimeType(string $path_to_file, string $fallback=self::APPLICATION__OCTET_STREAM, bool $a_external=false)
Interface ilFileDeliveryType.
setDisposition(string $disposition)
isConvertFileNameToAsci()
static http()
Fetches the global http state from ILIAS.
static setDEBUG(bool $DEBUG)
bool $convert_file_name_to_asci
cleanDownloadFileName()
Converts the filename to ASCII.
setExitAfter(bool $exit_after)
setDownloadFileName(string $download_file_name)
setDeliveryType(string $delivery_type)
setHashFilename(bool $hash_filename)
static getType()
Get context type.
setShowLastModified(bool $show_last_modified)
determineDownloadFileName()
string $download_file_name
The base interface for all filesystem streams.
setPathToFile(string $path_to_file)
setSendMimeType(bool $send_mime_type)