{"record":{"id":"d8df1100abdf2fc8","repo":"octobercms/october","slug":"file-name-already-exists","errorCode":null,"errorMessage":"File ':name' already exists.","messagePattern":"File ':name' already exists\\.","errorType":"exception","errorClass":"ApplicationException","httpStatus":500,"severity":"error","filePath":"modules/cms/classes/Asset.php","lineNumber":307,"sourceCode":"                    ['name' => $key]\n                ));\n            }\n\n            $this->$key = $value;\n        }\n    }\n\n    /**\n     * save the object to the disk\n     */\n    public function save()\n    {\n        $this->validateFileName();\n\n        $fullPath = $this->getFilePath();\n\n        if (File::isFile($fullPath) && $this->originalFileName !== $this->fileName) {\n            throw new ApplicationException(Lang::get(\n                'cms::lang.cms_object.file_already_exists',\n                ['name'=>$this->fileName]\n            ));\n        }\n\n        $dirPath = $this->theme->getPath().'/'.$this->dirName;\n        if (!file_exists($dirPath) || !is_dir($dirPath)) {\n            if (!File::makeDirectory($dirPath, 0755, true, true)) {\n                throw new ApplicationException(Lang::get(\n                    'cms::lang.cms_object.error_creating_directory',\n                    ['name'=>$dirPath]\n                ));\n            }\n        }\n\n        if (($pos = strpos($this->fileName, '/')) !== false) {\n            $dirPath = dirname($fullPath);\n","sourceCodeStart":289,"sourceCodeEnd":325,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/cms/classes/Asset.php#L289-L325","documentation":"Error \"File ':name' already exists.\" thrown in octobercms/october.","triggerScenarios":"Thrown at modules/cms/classes/Asset.php:307 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":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}