{"record":{"id":"a40ca1b3444e55ba","repo":"getgrav/grav","slug":"plugin-admin-failed-to-move-uploaded-file","errorCode":null,"errorMessage":"PLUGIN_ADMIN.FAILED_TO_MOVE_UPLOADED_FILE","messagePattern":"PLUGIN_ADMIN\\.FAILED_TO_MOVE_UPLOADED_FILE","errorType":"exception","errorClass":"RuntimeException","httpStatus":400,"severity":"error","filePath":"system/src/Grav/Common/Media/Traits/MediaUploadTrait.php","lineNumber":322,"sourceCode":"                    $this->doSaveMetadata(['upload' => $metadata], $name, $path);\n                }\n            } else {\n                // Not a FormFlashFile.\n                $this->doMoveUploadedFile($uploadedFile, $filename, $path);\n            }\n\n            // Post-processing: Special content sanitization for SVG.\n            $mime = Utils::getMimeByFilename($filename);\n            if (Utils::contains($mime, 'svg', false)) {\n                $this->doSanitizeSvg($filename, $path);\n            }\n\n            // Add the new file into the media.\n            // TODO: This overrides existing media sizes if used with multiple retina image sizes.\n            $this->doAddUploadedMedium($name, $filename, $path);\n\n        } catch (Exception $e) {\n            throw new RuntimeException($this->translate('PLUGIN_ADMIN.FAILED_TO_MOVE_UPLOADED_FILE') . $e->getMessage(), 400);\n        } finally {\n            // Finally clear media cache.\n            $locator->clearCache();\n            $this->clearCache();\n        }\n    }\n\n    /**\n     * Delete real file from the media collection.\n     *\n     * @param string $filename\n     * @param array|null $settings\n     * @return void\n     * @throws RuntimeException\n     */\n    public function deleteFile(string $filename, ?array $settings = null): void\n    {\n        // Add the defaults to the settings.","sourceCodeStart":304,"sourceCodeEnd":340,"githubUrl":"https://github.com/getgrav/grav/blob/6040efed04efa69b8209448ed81308e7c24147c2/system/src/Grav/Common/Media/Traits/MediaUploadTrait.php#L304-L340","documentation":"Error \"PLUGIN_ADMIN.FAILED_TO_MOVE_UPLOADED_FILE\" thrown in getgrav/grav.","triggerScenarios":"Thrown at system/src/Grav/Common/Media/Traits/MediaUploadTrait.php:322 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6040efed04efa69b8209448ed81308e7c24147c2","analyzedAt":"2026-08-17T05:07:31.593Z","schemaVersion":2},"datasetVersion":"2026-08-17T09:17:11.063Z"}