{"record":{"id":"c58a755d7e52bbf2","repo":"octobercms/october","slug":"error-deleting-file-name","errorCode":null,"errorMessage":"Error deleting file :name.","messagePattern":"Error deleting file :name\\.","errorType":"exception","errorClass":"ApplicationException","httpStatus":null,"severity":"error","filePath":"modules/cms/classes/Asset.php","lineNumber":377,"sourceCode":"     */\n    public function delete()\n    {\n        $fileName = Request::input('fileName');\n        $fullPath = $this->getFilePath($fileName);\n\n        $this->validateFileName($fileName);\n\n        if (!FileHelper::validateInTheme($this->theme, $fullPath)) {\n            throw new ValidationException(['fileName' =>\n                Lang::get('cms::lang.cms_object.invalid_file', [\n                    'name' => $fileName\n                ])\n            ]);\n        }\n\n        if (File::exists($fullPath)) {\n            if (!@File::delete($fullPath)) {\n                throw new ApplicationException(Lang::get(\n                    'cms::lang.asset.error_deleting_file',\n                    ['name' => $fileName]\n                ));\n            }\n        }\n    }\n\n    /**\n     * validateFileName supplied with extension and path.\n     * @param string $fileName\n     */\n    protected function validateFileName($fileName = null)\n    {\n        if ($fileName === null) {\n            $fileName = $this->fileName;\n        }\n\n        $fileName = trim($fileName);","sourceCodeStart":359,"sourceCodeEnd":395,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/cms/classes/Asset.php#L359-L395","documentation":"Error \"Error deleting file :name.\" thrown in octobercms/october.","triggerScenarios":"Thrown at modules/cms/classes/Asset.php:377 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"}