5 require_once(
'./Services/Utilities/classes/class.ilMimeTypeUtil.php');
6 require_once(
'./Services/Utilities/classes/class.ilUtil.php');
7 require_once(
'./Services/Context/classes/class.ilContext.php');
8 require_once(
'./Services/Http/classes/class.ilHTTPS.php');
9 require_once(
'./Services/FileDelivery/classes/FileDeliveryTypes/FileDeliveryTypeFactory.php');
10 require_once
'./Services/FileDelivery/classes/FileDeliveryTypes/DeliveryMethod.php';
114 $this->httpService = $httpState;
130 if (!$this->
delivery()->supportsStreaming()) {
139 return $this->fileDeliveryTypeFactory->getInstance($this->
getDeliveryType());
146 if (!$this->
delivery()->doesFileExists($this->path_to_file)) {
147 $response = $this->httpService->response()->withStatus(404);
148 $this->httpService->saveResponse(
$response);
149 $this->httpService->sendResponse();
152 $this->httpService->saveResponse(
$response);
173 $this->httpService->saveResponse(
$response);
183 $this->httpService->saveResponse(
$response);
188 $this->httpService->saveResponse(
$response);
191 $this->httpService->saveResponse(
$response);
228 $finfo = finfo_open(FILEINFO_MIME_TYPE);
258 if (self::$delivery_type_static) {
259 \ilWACLog::getInstance()->write(
'used cached delivery type');
265 if (function_exists(
'apache_get_modules')
266 && in_array(
'mod_xsendfile', apache_get_modules())
271 if (is_file(
'./Services/FileDelivery/classes/override.php')) {
272 $override_delivery_type =
false;
273 require_once(
'./Services/FileDelivery/classes/override.php');
274 if ($override_delivery_type) {
279 require_once(
'./Services/Environment/classes/class.ilRuntime.php');
281 if ((!$ilRuntime->isFPM() && !$ilRuntime->isHHVM())
536 $response = $this->httpService->response()->withHeader(
'ETag', $this->
getEtag());
537 $this->httpService->saveResponse(
$response);
545 $response = $this->httpService->response()->withHeader(
550 $this->httpService->saveResponse(
$response);
584 return (
bool) self::$DEBUG;
617 $ob_get_contents = ob_get_contents();
618 if ($ob_get_contents) {
688 foreach ($umlauts as $src => $tgt) {
689 $original_filename = str_replace($src, $tgt, $original_filename);
692 $ascii_filename = htmlentities($original_filename, ENT_NOQUOTES,
'UTF-8');
727 $response = $this->httpService->response();
736 $this->httpService->saveResponse(
$response);
Interface GlobalHttpState.
$convert_file_name_to_asci
setConvertFileNameToAsci($convert_file_name_to_asci)
__construct($path_to_file, GlobalHttpState $httpState)
Class FileDeliveryTypeFactory.
setDownloadFileName($download_file_name)
static lookupMimeType($path_to_file, $fallback=self::APPLICATION__OCTET_STREAM, $a_external=null)
setExitAfter($exit_after)
static $delivery_type_static
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static returnASCIIFileName($original_filename)
Converts a UTF-8 filename to ASCII.
isConvertFileNameToAsci()
setPathToFile($path_to_file)
setSendMimeType($send_mime_type)
setDeleteFile($delete_file)
cleanDownloadFileName()
Converts the filename to ASCII.
setShowLastModified($show_last_modified)
const APPLICATION__OCTET_STREAM
setHasContext($has_context)
setHashFilename($hash_filename)
static getType()
Get context type.
determineDownloadFileName()
setDisposition($disposition)
setDeliveryType($delivery_type)