19declare(strict_types=1);
37 use HeaderBasedDeliveryHelper;
41 public const DATA =
'data';
66 return is_readable($path_to_file);
78 $this->httpService->saveResponse(
$response);
87 public function deliver(
string $path_to_file,
bool $file_marked_to_delete): void
90 if (str_starts_with($path_to_file,
'./' .
self::DATA .
'/')) {
91 $path_to_file = str_replace(
'./' .
self::DATA .
'/',
'/' . self::SECURED_DATA
92 .
'/', $path_to_file);
95 $response = $this->httpService->response();
96 $delivery =
function () use ($path_to_file,
$response):
void {
98 $this->httpService->saveResponse(
$response);
99 $this->httpService->sendResponse();
102 if ($file_marked_to_delete) {
103 $this->sendFileUnbufferedUsingHeaders($delivery);
handleFileDeletion(string $path_to_file)
bool
supportsAttachmentDelivery()
prepare(string $path_to_file, ?FileStream $possible_stream)
bool
doesFileExists(string $path_to_file)
@inheritDoc
__construct(private Services $httpService)
PHP constructor.
deliver(string $path_to_file, bool $file_marked_to_delete)
void
Interface ilFileDeliveryType.
The base interface for all filesystem streams.