19 declare(strict_types=1);
62 return is_readable($path_to_file);
79 public function deliver(
string $path_to_file,
bool $file_marked_to_delete): void
81 $delivery =
function () use ($path_to_file):
void {
82 $response = $this->httpService->response()
83 ->withHeader(self::X_SENDFILE, realpath($path_to_file));
84 $this->httpService->saveResponse(
$response);
85 $this->httpService->sendResponse();
88 if ($file_marked_to_delete) {
89 $this->sendFileUnbufferedUsingHeaders($delivery);
128 return unlink($path_to_file);
doesFileExists(string $path_to_file)
supportsAttachmentDelivery()
Interface ilFileDeliveryType.
handleFileDeletion(string $path_to_file)
bool
const X_SENDFILE_TEMPORARY
prepare(string $path_to_file, ?FileStream $possible_stream)
__construct(private Services $httpService)
PHP constructor.
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.