19 declare(strict_types=1);
35 protected \ILIAS\ResourceStorage\Services
$irss;
44 $this->irss = $DIC->resourceStorage();
46 $this->temp_filesystem = $DIC->filesystem()->temp();
49 $this->sanitizer = new \ilFileServicesFilenameSanitizer(
50 $DIC->fileServiceSettings()
64 $result_array = $this->
upload->getResults();
65 $result = end($result_array);
68 if ($this->is_chunked) {
72 $identifier = $this->irss->manage()->upload($result, $this->stakeholder)->serialize();
79 'msg_info_blacklisted' 88 $temp_path = $this->sanitizer->sanitize(
"$this->chunk_id/{$result->getName()}");
91 if ($this->temp_filesystem->has($temp_path)) {
92 $stream = fopen($this->temp_filesystem->readStream($temp_path)->getMetadata()[
'uri'],
'ab');
93 fwrite($stream, file_get_contents($result->
getPath()));
95 $this->temp_filesystem->write($temp_path, file_get_contents($result->
getPath()));
107 $whole_file = $this->temp_filesystem->readStream($temp_path);
108 $id = $this->irss->manage()->stream($whole_file, $this->stakeholder, $result->
getName());
128 return $this->
ctrl->getLinkTargetByClass($this->class_path, self::CMD_UPLOAD, null,
true);
133 return $this->
ctrl->getLinkTargetByClass($this->class_path, self::CMD_INFO, null,
true);
138 return $this->
ctrl->getLinkTargetByClass($this->class_path, self::CMD_REMOVE, null,
true);
143 if (null !== (
$id = $this->irss->manage()->find($identifier))) {
144 $this->irss->manage()->remove(
$id, $this->stakeholder);
149 $message =
"file with identifier '$identifier' doesn't exist, nothing to do.";
157 if (null !== (
$id = $this->irss->manage()->find($identifier))) {
158 $revision = $this->irss->manage()->getCurrentRevision(
$id)->getInformation();
159 $title = $revision->getTitle();
161 $mime = $revision->getMimeType();
163 $title = $mime =
'unknown';
Class AbstractCtrlAwareIRSSUploadHandler.
ILIAS ResourceStorage Services $irss
processChunckedUpload(UploadResult $result)
getInfoForExistingFiles(array $file_ids)
ResourceStakeholder $stakeholder
getInfoResult(string $identifier)
Class BasicHandlerResult.
Interface FileInfoResult.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilCtrlAwareUploadHandler.
ILIAS Filesystem Filesystem $temp_filesystem
getFileIdentifierParameterName()
ilFileServicesFilenameSanitizer $sanitizer
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Interface ResourceStakeholder.
getRemoveResult(string $identifier)
Class BasicFileInfoResult.