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);
73 $result_array = $this->
upload->getResults();
74 $result = end($result_array);
77 if ($this->is_chunked) {
81 if ($this->upload_mode === self::MODE_REPLACE) {
82 $identifier = (string) $this->file->replaceWithUpload($result, $result->getName());
84 $identifier = (string) $this->file->appendUpload($result, $result->getName());
86 $status = HandlerResult::STATUS_OK;
90 $status = HandlerResult::STATUS_FAILED;
91 $message = $result->getStatus()->getMessage();
104 $temp_path =
"$this->chunk_id/{$result->getName()}";
107 if ($this->temp_filesystem->has($temp_path)) {
108 $stream = fopen($this->temp_filesystem->readStream($temp_path)->getMetadata()[
'uri'],
'ab');
109 fwrite($stream, file_get_contents($result->
getPath()));
111 $this->temp_filesystem->write($temp_path, file_get_contents($result->
getPath()));
116 HandlerResult::STATUS_FAILED,
123 $whole_file = $this->temp_filesystem->readStream($temp_path);
124 if ($this->upload_mode === self::MODE_REPLACE) {
125 $revision_number = $this->file->replaceWithStream($whole_file, $result->
getName());
127 $revision_number = $this->file->appendStream($whole_file, $result->
getName());
132 HandlerResult::STATUS_OK,
133 (
string) $revision_number,
140 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.
Class BasicHandlerResult.
processChunckedUpload(UploadResult $result)
getFileIdentifierParameterName()
Class ilCountPDFPagesPreProcessors.
Interface ResourceStakeholder.