2 require_once(
'./Services/FileDelivery/classes/FileDeliveryTypes/FileDeliveryTypeFactory.php');
3 require_once
'./Services/FileDelivery/classes/FileDeliveryTypes/DeliveryMethod.php';
4 require_once(
'./Services/FileDelivery/classes/Delivery.php');
5 require_once(
'./Services/FileDelivery/interfaces/int.ilFileDeliveryService.php');
6 require_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;
static returnASCIIFileName($original_filename)
Converts a UTF-8 filename to ASCII.UFT8-Filenamestring ASCII-Filename
__construct($filePath)
ilFileDelivery constructor.
static streamVideoInline($path_to_file, $download_file_name='')
void
Interface ilFileDeliveryService.
static http()
Fetches the global http state from ILIAS.
static deliverFileAttached($path_to_file, $download_file_name='', $mime_type='', $delete_file=false)
void
static deliverFileInline($path_to_file, $download_file_name='')
void
const DELIVERY_METHOD_PHP
Create styles array
The data for the language used.
static isNonEmptyString($text)
Checks if the string is not empty.
const DELIVERY_METHOD_XSENDFILE
__call($name, array $arguments)
Workaround because legacy components try to call methods which are moved to the Deliver class...
trait HttpServiceAware
Trait HttpServiceAware.
const DELIVERY_METHOD_PHP_CHUNKED
const DELIVERY_METHOD_XACCEL