ILIAS  release_8 Revision v8.24
class.ilPHPOutputDelivery.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
8
9/******************************************************************************
10 *
11 * This file is part of ILIAS, a powerful learning management system.
12 *
13 * ILIAS is licensed with the GPL-3.0, you should have received a copy
14 * of said license along with the source code.
15 *
16 * If this is not the case or you just want to try ILIAS, you'll find
17 * us at:
18 * https://www.ilias.de
19 * https://github.com/ILIAS-eLearning
20 *
21 *****************************************************************************/
31{
33 protected ?Delivery $ilFileDelivery = null;
34
35
39 public function start(string $download_file_name, string $mime_type = MimeType::APPLICATION__OCTET_STREAM): void
40 {
41 global $DIC;
42 $ilClientIniFile = $DIC['ilClientIniFile'];
44 $this->ilFileDelivery->setMimeType($mime_type);
45 $this->ilFileDelivery->setDownloadFileName($download_file_name);
46 $this->ilFileDelivery->setDisposition(ilFileDelivery::DISP_ATTACHMENT);
47 $this->ilFileDelivery->setConvertFileNameToAsci((bool) !$ilClientIniFile->readVariable('file_access', 'disable_ascii'));
48 $this->ilFileDelivery->clearBuffer();
49 $this->ilFileDelivery->checkCache();
50 $this->ilFileDelivery->setGeneralHeaders();
51 $this->ilFileDelivery->setShowLastModified(false);
52 $this->ilFileDelivery->setCachingHeaders();
53 }
54
55
56 public function stop(): void
57 {
58 $this->ilFileDelivery->close();
59 }
60}
Mime type determination.
Definition: MimeType.php:28
Class ilFileDelivery.
Class ilPHPOutputDelivery.
start(string $download_file_name, string $mime_type=MimeType::APPLICATION__OCTET_STREAM)
global $DIC
Definition: feed.php:28
trait HttpServiceAware
Trait HttpServiceAware.
static http()
Fetches the global http state from ILIAS.