{"record":{"id":"aab8979458a52e3d","repo":"octobercms/october","slug":"file-not-found","errorCode":null,"errorMessage":"File not found","messagePattern":"File not found","errorType":"exception","errorClass":"ApplicationException","httpStatus":null,"severity":"error","filePath":"modules/backend/controllers/Files.php","lineNumber":172,"sourceCode":"     * findFileObject locates a file model based on the unique code.\n     * @param $code string\n     * @return System\\Models\\File\n     */\n    protected function findFileObject($code)\n    {\n        if (!$code) {\n            throw new ApplicationException('Missing code');\n        }\n\n        $parts = explode('!', base64_decode($code));\n        if (count($parts) < 2) {\n            throw new ApplicationException('Invalid code');\n        }\n\n        [$id, $hash] = $parts;\n\n        if (!$file = FileModel::find((int) $id)) {\n            throw new ApplicationException('File not found');\n        }\n\n        // Ensure that the file model utilized for this request is\n        // the one specified in the relationship configuration\n        if ($file->attachment) {\n            $fileModel = $file->attachment->{$file->field}()->getRelated();\n\n            // Only attempt to get file model through its assigned class\n            // when the assigned class differs from the default one that\n            // the file has already been loaded from\n            if (get_class($file) !== get_class($fileModel)) {\n                $file = $fileModel->find($file->id);\n            }\n        }\n\n        $verifyCode = self::getUniqueCode($file);\n        if ($code != $verifyCode) {\n            throw new ApplicationException('Invalid hash');","sourceCodeStart":154,"sourceCodeEnd":190,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/backend/controllers/Files.php#L154-L190","documentation":"Error \"File not found\" thrown in octobercms/october.","triggerScenarios":"Thrown at modules/backend/controllers/Files.php:172 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"}