19declare(strict_types=1);
56 $this->
ctrl = $DIC->ctrl();
57 $this->
upload = $DIC->upload();
58 $this->
http = $DIC->http();
76 return $this->
ctrl->getLinkTargetByClass([static::class], self::CMD_UPLOAD);
85 return $this->
ctrl->getLinkTargetByClass([static::class], self::CMD_INFO);
94 return $this->
ctrl->getLinkTargetByClass([static::class], self::CMD_REMOVE);
99 $body = $this->
http->request()->getParsedBody();
100 $this->chunk_id = $body[
'dzuuid'] ??
null;
101 $this->amount_of_chunks = (
int) ($body[
'dztotalchunkcount'] ?? 0);
102 $this->chunk_index = (
int) ($body[
'dzchunkindex'] ?? 0);
103 $this->chunk_total_size = (
int) ($body[
'dztotalfilesize'] ?? 0);
104 $this->is_chunked = ($this->chunk_id !==
null && $this->amount_of_chunks > 0);
110 switch ($this->
ctrl->getCmd()) {
119 }
catch (\Throwable $t) {
120 $content = json_encode(
140 $content = json_encode($this->
getInfoResult($file_identifier));
148 $this->
http->sendResponse();
149 $this->
http->close();
Class ilCtrlAwareUploadHandler.
getFileRemovalURL()
@inheritDoc
getInfoResult(string $identifier)
getInfoForExistingFiles(array $file_ids)
getFileIdentifierParameterName()
@inheritDoc
__construct()
ilUIDemoFileUploadHandlerGUI constructor.
getUploadURL()
@inheritDoc
executeCommand()
Since this is a ilCtrl aware UploadHandler executeCommand MUST be implemented.
getRemoveResult(string $identifier)
getExistingFileInfoURL()
@inheritDoc
Class BasicHandlerResult.
Stream factory which enables the user to create streams without the knowledge of the concrete class.
static ofString(string $string)
Creates a new stream with an initial value.
Class ilCtrl provides processing control methods.
Interface FileInfoResult.
Class ilCtrlAwareUploadHandler.
static http()
Fetches the global http state from ILIAS.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...