19 declare(strict_types=1);
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);
__construct(private Services $httpService)
PHP constructor.
prepare(string $path_to_file, ?FileStream $possible_stream)
doesFileExists(string $path_to_file)
supportsAttachmentDelivery()
handleFileDeletion(string $path_to_file)
bool
Interface ilFileDeliveryType.
deliver(string $path_to_file, bool $file_marked_to_delete)
absolute path to fileThis is needed at this point for header-based delivery methodsvoid ...
The base interface for all filesystem streams.