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';
113 $this->httpService = $httpState;
129 if (!$this->
delivery()->supportsStreaming()) {
138 return $this->fileDeliveryTypeFactory->getInstance($this->
getDeliveryType());
145 if (!$this->
delivery()->doesFileExists($this->path_to_file)) {
146 $response = $this->httpService->response()->withStatus(404);
147 $this->httpService->saveResponse(
$response);
148 $this->httpService->sendResponse();
151 $this->httpService->saveResponse(
$response);
172 $this->httpService->saveResponse(
$response);
182 $this->httpService->saveResponse(
$response);
187 $this->httpService->saveResponse(
$response);
190 $this->httpService->saveResponse(
$response);
198 $this->httpService->saveResponse(
$response);
227 $finfo = finfo_open(FILEINFO_MIME_TYPE);
257 if (self::$delivery_type_static) {
258 \ilWACLog::getInstance()->write(
'used cached delivery type');
264 if (function_exists(
'apache_get_modules')
265 && in_array(
'mod_xsendfile', apache_get_modules())
270 if (is_file(
'./Services/FileDelivery/classes/override.php')) {
271 $override_delivery_type =
false;
272 require_once(
'./Services/FileDelivery/classes/override.php');
273 if ($override_delivery_type) {
278 require_once(
'./Services/Environment/classes/class.ilRuntime.php');
280 if ((!$ilRuntime->isFPM() && !$ilRuntime->isHHVM())
535 $response = $this->httpService->response()->withHeader(
'ETag', $this->
getEtag());
536 $this->httpService->saveResponse(
$response);
544 $response = $this->httpService->response()->withHeader(
549 $this->httpService->saveResponse(
$response);
583 return (
bool) self::$DEBUG;
616 $ob_get_contents = ob_get_contents();
617 if ($ob_get_contents) {
687 foreach ($umlauts as $src => $tgt) {
688 $original_filename = str_replace($src, $tgt, $original_filename);
691 $ascii_filename = htmlentities($original_filename, ENT_NOQUOTES,
'UTF-8');
726 $response = $this->httpService->response();
735 $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
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)