getgrav/grav · error · RuntimeException

Uploaded file could not be moved to %s

Error message

Uploaded file could not be moved to %s

What it means

Error "Uploaded file could not be moved to %s" thrown in getgrav/grav.

Source

Thrown at system/src/Grav/Framework/Form/FormFlashFile.php:97

     * @param string $targetPath
     * @return void
     */
    public function moveTo(string $targetPath): void
    {
        $this->validateActive();

        if ($targetPath === '') {
            throw new InvalidArgumentException('Invalid path provided for move operation; must be a non-empty string');
        }
        $tmpFile = $this->getTmpFile();
        if (null === $tmpFile) {
            throw new RuntimeException('No temporary file');
        }

        $this->moved = copy($tmpFile, $targetPath);

        if (false === $this->moved) {
            throw new RuntimeException(sprintf('Uploaded file could not be moved to %s', $targetPath));
        }

        $filename = $this->getClientFilename();
        if ($filename) {
            $this->flash->removeFile($filename, $this->field);
        }
    }

    public function getId(): string
    {
        return $this->id;
    }

    /**
     * @return string
     */
    public function getField(): string
    {

View on GitHub (pinned to 6040efed04)

When it happens

Trigger: Thrown at system/src/Grav/Framework/Form/FormFlashFile.php:97 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of getgrav/grav@6040efed04 (2026-08-17). Data as JSON: /api/errors/8cc6723cb96b4bcb. Report an issue: GitHub.