2require_once(
'./Services/FileDelivery/classes/FileDeliveryTypes/FileDeliveryTypeFactory.php');
 
    3require_once 
'./Services/FileDelivery/classes/FileDeliveryTypes/DeliveryMethod.php';
 
    4require_once(
'./Services/FileDelivery/classes/Delivery.php');
 
    5require_once(
'./Services/FileDelivery/interfaces/int.ilFileDeliveryService.php');
 
    6require_once 
'./Services/FileDelivery/classes/HttpServiceAware.php';
 
   44        assert(is_string($filePath));
 
   52    public static function deliverFileAttached($path_to_file, $download_file_name = 
'', $mime_type = 
'', $delete_file = 
false)
 
   54        assert(is_string($path_to_file));
 
   55        assert(is_string($download_file_name));
 
   56        assert(is_string($mime_type));
 
   57        assert(is_bool($delete_file));
 
   61        if (self::isNonEmptyString($download_file_name)) {
 
   62            $obj->setDownloadFileName($download_file_name);
 
   64        if (self::isNonEmptyString($mime_type)) {
 
   65            $obj->setMimeType($mime_type);
 
   67        $obj->setDisposition(self::DISP_ATTACHMENT);
 
   68        $obj->setDeleteFile($delete_file);
 
   78        assert(is_string($path_to_file));
 
   79        assert(is_string($download_file_name));
 
   81        if (self::isNonEmptyString($download_file_name)) {
 
   82            $obj->setDownloadFileName($download_file_name);
 
   84        $obj->setDisposition(self::DISP_INLINE);
 
   94        assert(is_string($path_to_file));
 
   95        assert(is_string($download_file_name));
 
   98        if (self::isNonEmptyString($download_file_name)) {
 
   99            $obj->setDownloadFileName($download_file_name);
 
  101        $obj->setDisposition(self::DISP_INLINE);
 
  111        assert(is_string($original_filename));
 
  113        return Delivery::returnASCIIFileName($original_filename);
 
  127        assert(is_string(
$name));
 
  129        call_user_func_array([ $this->delivery, 
$name ], $arguments);
 
  142        assert(is_string(
$text));
 
  144        return (
bool) strcmp(
$text, 
'') !== 0;
 
An exception for terminatinating execution or to throw for unit testing.
static deliverFileAttached($path_to_file, $download_file_name='', $mime_type='', $delete_file=false)
void
static isNonEmptyString($text)
Checks if the string is not empty.
const DELIVERY_METHOD_PHP_CHUNKED
__construct($filePath)
ilFileDelivery constructor.
static deliverFileInline($path_to_file, $download_file_name='')
void
__call($name, array $arguments)
Workaround because legacy components try to call methods which are moved to the Deliver class.
const DELIVERY_METHOD_XACCEL
static returnASCIIFileName($original_filename)
Converts a UTF-8 filename to ASCII.string ASCII-Filename
static streamVideoInline($path_to_file, $download_file_name='')
void
const DELIVERY_METHOD_PHP
const DELIVERY_METHOD_XSENDFILE
Interface ilFileDeliveryService.
trait HttpServiceAware
Trait HttpServiceAware.
static http()
Fetches the global http state from ILIAS.