44 $this->upload_mode = $this->
http->wrapper()->query()->has(self::P_UPLOAD_MODE)
45 ? $this->
http->wrapper()->query()->retrieve(self::P_UPLOAD_MODE, $DIC->refinery()->kindlyTo()->string())
48 $this->
ctrl->setParameter($this, self::P_UPLOAD_MODE, $this->upload_mode);
75 $result_array = $this->
upload->getResults();
76 $result = end($result_array);
79 if ($this->is_chunked) {
83 if ($this->upload_mode === self::MODE_REPLACE) {
84 $identifier = (string) $this->file->replaceWithUpload($result, $result->getName());
86 $identifier = (string) $this->file->appendUpload($result, $result->getName());
88 $status = HandlerResult::STATUS_OK;
92 $status = HandlerResult::STATUS_FAILED;
93 $message = $result->getStatus()->getMessage();
107 $temp_path =
"$this->chunk_id/{$result->getName()}";
110 if ($this->temp_filesystem->has($temp_path)) {
111 $stream = fopen($this->temp_filesystem->readStream($temp_path)->getMetadata()[
'uri'],
'ab');
112 fwrite($stream, file_get_contents($result->
getPath()));
114 $this->temp_filesystem->write($temp_path, file_get_contents($result->
getPath()));
119 HandlerResult::STATUS_FAILED,
126 $whole_file = $this->temp_filesystem->readStream($temp_path);
127 if ($this->upload_mode === self::MODE_REPLACE) {
128 $revision_number = $this->file->replaceWithStream($whole_file, $result->
getName());
130 $revision_number = $this->file->appendStream($whole_file, $result->
getName());
135 HandlerResult::STATUS_OK,
136 (
string) $revision_number,
143 HandlerResult::STATUS_PARTIAL,
Class ilObjFileStakeholder.
Class AbstractCtrlAwareIRSSUploadHandler.
__construct(protected ilObjFile $file, string $upload_mode=self::MODE_APPEND)
static http()
Fetches the global http state from ILIAS.
Class ilFileVersionsUploadHandlerGUI.
getFileIdentifierParameterName()
Class BasicHandlerResult.
processChunckedUpload(UploadResult $result)
__construct(Container $dic, ilPlugin $plugin)
Class ilCountPDFPagesPreProcessors.
Interface ResourceStakeholder.