19declare(strict_types=1);
46 $this->irss =
$DIC->resourceStorage();
48 $this->temp_filesystem =
$DIC->filesystem()->temp();
51 $this->sanitizer = new \ilFileServicesFilenameSanitizer(
52 $DIC->fileServiceSettings()
66 $result_array = $this->
upload->getResults();
67 $result = end($result_array);
70 if ($this->is_chunked) {
74 $identifier = $this->irss->manage()->upload($result, $this->stakeholder)->serialize();
81 'msg_info_blacklisted'
90 $temp_path = $this->sanitizer->sanitize(
"$this->chunk_id/{$result->getName()}");
93 if ($this->temp_filesystem->has($temp_path)) {
94 $stream = fopen($this->temp_filesystem->readStream($temp_path)->getMetadata()[
'uri'],
'ab');
95 fwrite($stream, file_get_contents($result->
getPath()));
97 $this->temp_filesystem->write($temp_path, file_get_contents($result->
getPath()));
99 }
catch (\Throwable $t) {
108 if (($this->chunk_index + 1) === $this->amount_of_chunks) {
109 $whole_file = $this->temp_filesystem->readStream($temp_path);
110 $id = $this->irss->manage()->stream($whole_file, $this->stakeholder, $result->
getName());
131 return $this->
ctrl->getLinkTargetByClass($this->class_path, self::CMD_UPLOAD,
null,
true);
137 return $this->
ctrl->getLinkTargetByClass($this->class_path, self::CMD_INFO,
null,
true);
143 return $this->
ctrl->getLinkTargetByClass($this->class_path, self::CMD_REMOVE,
null,
true);
148 if (
null !== (
$id = $this->irss->manage()->find($identifier))) {
149 $this->irss->manage()->remove(
$id, $this->stakeholder);
154 $message =
"file with identifier '$identifier' doesn't exist, nothing to do.";
162 if (
null !== (
$id = $this->irss->manage()->find($identifier))) {
163 $revision = $this->irss->manage()->getCurrentRevision(
$id)->getInformation();
164 $title = $revision->getTitle();
166 $mime = $revision->getMimeType();
168 $title = $mime =
'unknown';
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Class AbstractCtrlAwareIRSSUploadHandler.
processChunckedUpload(UploadResult $result)
getRemoveResult(string $identifier)
getFileRemovalURL()
@inheritDoc
ResourceStakeholder $stakeholder
ilFileServicesFilenameSanitizer $sanitizer
__construct()
ilUIDemoFileUploadHandlerGUI constructor.
getInfoForExistingFiles(array $file_ids)
getUploadURL()
@inheritDoc
getInfoResult(string $identifier)
Filesystem $temp_filesystem
getExistingFileInfoURL()
@inheritDoc
Class ilCtrlAwareUploadHandler.
getFileIdentifierParameterName()
@inheritDoc
Class BasicFileInfoResult.
Class BasicHandlerResult.
Interface FileInfoResult.
The filesystem interface provides the public interface for the Filesystem service API consumer.
Interface ResourceStakeholder.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc