3 declare(strict_types=1);
34 public const DATA =
'data';
47 $this->httpService = $httpState;
55 return is_readable($path_to_file);
63 public function prepare(
string $path_to_file): bool
67 $this->httpService->saveResponse(
$response);
76 public function deliver(
string $path_to_file,
bool $file_marked_to_delete): void
79 if (strpos($path_to_file,
'./' . self::DATA .
'/') === 0) {
80 $path_to_file = str_replace(
'./' . self::DATA .
'/',
'/' . self::SECURED_DATA
81 .
'/', $path_to_file);
84 $response = $this->httpService->response();
85 $delivery =
function () use ($path_to_file,
$response):
void {
87 $this->httpService->saveResponse(
$response);
88 $this->httpService->sendResponse();
91 if ($file_marked_to_delete) {
92 $this->sendFileUnbufferedUsingHeaders($delivery);
__construct(Services $httpState)
PHP constructor.
doesFileExists(string $path_to_file)
supportsAttachmentDelivery()
handleFileDeletion(string $path_to_file)
bool
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface ilFileDeliveryType.
ILIAS HTTP Services $httpService
deliver(string $path_to_file, bool $file_marked_to_delete)
absolute path to fileThis is needed at this point for header-based delivery methodsvoid ...
prepare(string $path_to_file)
bool