Called when uploaded file is set from form.

@since 1.0.0

@param UploadedFileInterface|null $uploadedFile The file from form.
351662
protected function onSetUploadedFile(?UploadedFileInterface $uploadedFile = null): void
    {
        $this->file = $uploadedFile;

        parent::onSetUploadedFile();
    }
692704
public function processUploadedFile($originalFile, $newFile, $folder)
    {
        if (substr($folder, -1) != '/') $folder = $folder . '/';
        @move_uploaded_file($originalFile, $folder . $newFile) or die("File: '{$originalFile}' couldn't be moved '{$folder}'.");
        @chmod($folder . $newFile, 0777) or die("Error with chmod() function on file: '{$newFile}' in folder '{$folder}'.");
    }
842762
public function getUploadPath(UploadedFile $file)
    {
        if (! is_callable($this->uploadPath)) {
            return $this->defaultUploadPath($file);
        }

        return call_user_func($this->uploadPath, $file);
    }
383979
public static function hasValidMimeType(UploadedFile $uploadedFile, array $arrMimeType) : bool
    {
        return count($arrMimeType) > 0 ? in_array($uploadedFile->getMimeType(), $arrMimeType) : true;
    }
483403
public function setFile($file = null)
    {
        if ($file instanceof UploadedFile) {
            $this->file = base64_encode(file_get_contents($file));
        } else {
            $this->file = $file;
        }

        return $this;
    }
438787
protected function submitAddFile()
    {
        $this->setSubmitted(null, $this->getParam());
        $this->validateComponent('file');
        $this->addFile();
    }
1111697
public function set(string $name, UploadedFileInterface $uploadedFile): void
    {
        $this->uploadedFiles[$name] = $uploadedFile;
    }
1356766
protected function fileUpdate()
    {
        foreach ($this->getAsserts() as $field => $asserts) {
            if ($this->$field instanceof UploadedFile) {
                $tempField = '_'.$field;
                $tempFile = $this->getFilePath($tempField, true);
                is_file($tempFile) && unlink($tempFile);
                $this->bean->removeProperty($tempField);

                $this->$field = $this->moveFile($this->$field);
            }
        }
    }
931796
protected static function validUploadedFiles(array $uploadedFiles, string $index = ""){
        foreach($uploadedFiles as $key => $file){
            $_index = "" === $index ? $key : ($index . "." . $key);

            if(is_array($file)){
                self::validUploadedFiles($file, $_index);
                continue;
            }

            if(!is_subclass_of($file, UploadedFileInterface::class)){
                $class  = UploadedFileInterface::class;

                throw new \InvalidArgumentException(
                    "Of the uploaded files, '{$_index}' is not an instance of"
                    . " the class implementing {$class}"
                );
            }
        }
    }
1126597
public function handleUploadedFile(UploadedFile $file)
    {
        if ($file->getClientOriginalExtension() === 'zip') {
            $tempFolder = $this->extractZip($file);
            $counters = array('new' => 0, 'updated' => 0);
            foreach (scandir($tempFolder) as $path) {
                if (is_file($tempFolder.'/'.$path)) {
                    $fileCounters = $this->importFile($tempFolder.'/'.$path);
                    $counters['new'] += $fileCounters['new'];
                    $counters['updated'] += $fileCounters['updated'];
                }
            }
            unset($tempFolder);
        } else {
            $counters = $this->importFile($file->getRealPath(), $file->getClientOriginalName());
        }

        return $counters;
    }
921953
void handleUpload(List<String> uploadedFiles) {

        CmsObject cms = A_CmsUI.getCmsObject();
        boolean success = OpenCms.getWorkplaceAppManager().getUserIconHelper().handleImageUpload(cms, uploadedFiles);
        if (success) {
            refreshUserInfoDropDown();
        }
    }
408721
public function withUploadedFiles(array $uploadedFiles)
    {
        $new        = clone $this;
        $new->files = clone $this->files;
        $files      = [];
        foreach ($uploadedFiles as $file) {
            /** @var UploadedFileInterface $file */
            $filename = tempnam(sys_get_temp_dir(), 'upload');
            $handle   = fopen($filename, 'wb');
            fwrite($handle, $file->getStream()->getContents());
            fclose($handle);
            $files[] = new UploadedFile(
                $filename,
                $file->getClientFilename(),
                $file->getClientMediaType(),
                $file->getSize(),
                $file->getError()
            );
        }
        $new->files->add($files);

        return $new;
    }
882466
public final function withUploadedFiles(
       array $uploadedFiles): ServerRequestInterface
   {
       foreach ($uploadedFiles as &$value) {
           if (!$value instanceof UploadedFileInterface) {
               throw new InvalidArgumentException(
                   "Can't get instance: "
                 . "must implement UploadedFileInterface");
           }
       }
       return $this->with("uploadedFiles", $uploadedFiles);
   }
426621
private function createUploadedFile(UploadedFile $symfonyUploadedFile)
    {
        return $this->uploadedFileFactory->createUploadedFile(
            $this->streamFactory->createStreamFromFile(
                $symfonyUploadedFile->getRealPath()
            ),
            (int) $symfonyUploadedFile->getSize(),
            $symfonyUploadedFile->getError(),
            $symfonyUploadedFile->getClientOriginalName(),
            $symfonyUploadedFile->getClientMimeType()
        );
    }
204694
public static function isValidUploadFile(UploadedFile $uploadedFile, array $arrMimeType = array()) : bool
    {
        if (empty($uploadedFile) || !$uploadedFile->isValid()) {
            return false;
        }

        return self::hasValidMimeType($uploadedFile, $arrMimeType);
    }
541366
protected function prepareForeach(UploadedFile $image = null)
    {
        $self       = clone $this;
        $self->name = $self->getStoreName($image);

        $self->callInterventionMethods($image->getRealPath());

        return tap($self->upload($image), function () use ($self) {
            $self->name = null;
        });
    }
1098241
public function setFile(UploadedFile $file = null)
    {
        $this->file = $file;
        $this->name = $file->getClientOriginalName();
        // check if we have an old image path
        if (isset($this->path)) {
            // store the old name to delete after the update
            $this->temp = $this->path;
            $this->path = null;
        } else {
            $this->path = 'initial';
        }
    }