19 declare(strict_types=1);
38 public const DATA =
'data';
51 $this->httpService = $httpState;
59 return is_readable($path_to_file);
71 $this->httpService->saveResponse(
$response);
80 public function deliver(
string $path_to_file,
bool $file_marked_to_delete): void
83 if (strpos($path_to_file,
'./' .
self::DATA .
'/') === 0) {
84 $path_to_file = str_replace(
'./' .
self::DATA .
'/',
'/' . self::SECURED_DATA
85 .
'/', $path_to_file);
88 $response = $this->httpService->response();
89 $delivery =
function () use ($path_to_file,
$response):
void {
91 $this->httpService->saveResponse(
$response);
92 $this->httpService->sendResponse();
95 if ($file_marked_to_delete) {
96 $this->sendFileUnbufferedUsingHeaders($delivery);
__construct(Services $httpState)
PHP constructor.
prepare(string $path_to_file, ?FileStream $possible_stream)
bool
doesFileExists(string $path_to_file)
supportsAttachmentDelivery()
handleFileDeletion(string $path_to_file)
bool
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 ...
The base interface for all filesystem streams.