19declare(strict_types=1);
43 $this->temp_system =
$DIC->filesystem()->temp();
55 $result_array = $this->
upload->getResults();
56 $result = end($result_array);
60 && in_array($result->getMimeType(), $this->supported_mime_types)
62 $status = HandlerResult::STATUS_OK;
66 $status = HandlerResult::STATUS_FAILED;
67 $message = $result->getStatus()->getMessage();
82 HandlerResult::STATUS_OK,
84 "We just don't do anything here."
90 if ($this->temp_system->hasDir($file_name)
91 && ($files = $this->temp_system->listContents($file_name))) {
92 $path = $files[0]->getPath();
95 $mime = $this->temp_system->getMimeType(
$path);
96 $size = intval($this->temp_system->getSize(
$path, DataSize::Byte)->inBytes());
99 $title = $mime =
'unknown';
122 $tempfile_path = uniqid(
'tmp');
123 $this->temp_system->createDir($tempfile_path);
124 $this->temp_system->put(
126 file_get_contents($result->
getPath())
128 return $tempfile_path;
This class provides the data size with additional information to remove the work to calculate the siz...
Class ilCtrlAwareUploadHandler.
getFileIdentifierParameterName()
@inheritDoc
__construct()
ilUIDemoFileUploadHandlerGUI constructor.
Class BasicFileInfoResult.
Class BasicHandlerResult.
getUploadResult()
@inheritDoc
getInfoForExistingFiles(array $file_names)
getRemoveResult(string $filename)
array $supported_mime_types
getInfoResult(string $file_name)
moveUploadedFileToTemp(UploadResult $result)
static getValidFilename(string $a_filename)
const SUPPORTED_IMPORT_MIME_TYPES
Interface FileInfoResult.
The filesystem interface provides the public interface for the Filesystem service API consumer.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc