3declare(strict_types=1);
33 use HeaderBasedDeliveryHelper;
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);
handleFileDeletion(string $path_to_file)
bool
supportsAttachmentDelivery()
prepare(string $path_to_file)
bool
doesFileExists(string $path_to_file)
@inheritDoc
ILIAS HTTP Services $httpService
__construct(Services $httpState)
PHP constructor.
deliver(string $path_to_file, bool $file_marked_to_delete)
void
Interface ilFileDeliveryType.