ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilPHPOutputDelivery.php
Go to the documentation of this file.
1 <?php
2 require_once('class.ilFileDelivery.php');
3 require_once('Delivery.php');
4 require_once './Services/FileDelivery/classes/HttpServiceAware.php';
5 
8 
18 {
19  use HttpServiceAware;
23  protected $ilFileDelivery;
24 
25 
30  public function start($download_file_name, $mime_type = ilMimeTypeUtil::APPLICATION__OCTET_STREAM)
31  {
32  global $DIC;
33  $ilClientIniFile = $DIC['ilClientIniFile'];
35  $this->ilFileDelivery->setMimeType($mime_type);
36  $this->ilFileDelivery->setDownloadFileName($download_file_name);
37  $this->ilFileDelivery->setDisposition(ilFileDelivery::DISP_ATTACHMENT);
38  $this->ilFileDelivery->setConvertFileNameToAsci((bool) !$ilClientIniFile->readVariable('file_access', 'disable_ascii'));
39  $this->ilFileDelivery->clearBuffer();
40  $this->ilFileDelivery->checkCache();
41  $this->ilFileDelivery->setGeneralHeaders();
42  $this->ilFileDelivery->setShowLastModified(false);
43  $this->ilFileDelivery->setCachingHeaders();
44  }
45 
46 
47  public function stop()
48  {
49  $this->ilFileDelivery->close();
50  }
51 }
global $DIC
Definition: saml.php:7
start($download_file_name, $mime_type=ilMimeTypeUtil::APPLICATION__OCTET_STREAM)
static http()
Fetches the global http state from ILIAS.
trait HttpServiceAware
Trait HttpServiceAware.
Class ilFileDelivery.
Class ilPHPOutputDelivery.