ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilPHPOutputDelivery.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
25
35{
36 use HttpServiceAware;
37 protected ?Delivery $ilFileDelivery = null;
38
39
43 public function start(string $download_file_name, string $mime_type = MimeType::APPLICATION__OCTET_STREAM): void
44 {
45 $settings = new General();
47 $this->ilFileDelivery->setMimeType($mime_type);
48 $this->ilFileDelivery->setDownloadFileName($download_file_name);
49 $this->ilFileDelivery->setDisposition(ilFileDelivery::DISP_ATTACHMENT);
50 $this->ilFileDelivery->setConvertFileNameToAsci($settings->isDownloadWithAsciiFileName());
51 $this->ilFileDelivery->clearBuffer();
52 $this->ilFileDelivery->checkCache();
53 $this->ilFileDelivery->setGeneralHeaders();
54 $this->ilFileDelivery->setShowLastModified(false);
55 $this->ilFileDelivery->setCachingHeaders();
56 }
57
58
59 public function stop(): void
60 {
61 $this->ilFileDelivery->close();
62 }
63}
trait HttpServiceAware
Trait HttpServiceAware.
Mime type determination.
Definition: MimeType.php:30
Class ilFileDelivery.
Class ilPHPOutputDelivery.
start(string $download_file_name, string $mime_type=MimeType::APPLICATION__OCTET_STREAM)
static http()
Fetches the global http state from ILIAS.