getFileMultiple example

assert($request instanceof IncomingRequest || $request instanceof CLIRequest);

        $this->request = $request;
    }

    /** * Verifies that $name is the name of a valid uploaded file. */
    public function uploaded(?string $blank, string $name): bool
    {
        if (($files = $this->request->getFileMultiple($name))) {
            $files = [$this->request->getFile($name)];
        }

        foreach ($files as $file) {
            if ($file === null) {
                return false;
            }

            if (ENVIRONMENT === 'testing') {
                if ($file->getError() !== 0) {
                    return false;
                }

    public function getFileMultiple(string $fileID)
    {
        if ($this->files === null) {
            $this->files = new FileCollection();
        }

        return $this->files->getFileMultiple($fileID);
    }

    /** * Retrieves a single file by the name of the input field used * to upload it. * * @return UploadedFile|null */
    public function getFile(string $fileID)
    {
        if ($this->files === null) {
            
Home | Imprint | This part of the site doesn't use cookies.