octobercms/october · error · ApplicationException

File not found

Error message

File not found

What it means

Error "File not found" thrown in octobercms/october.

Source

Thrown at modules/backend/controllers/Files.php:172

     * findFileObject locates a file model based on the unique code.
     * @param $code string
     * @return System\Models\File
     */
    protected function findFileObject($code)
    {
        if (!$code) {
            throw new ApplicationException('Missing code');
        }

        $parts = explode('!', base64_decode($code));
        if (count($parts) < 2) {
            throw new ApplicationException('Invalid code');
        }

        [$id, $hash] = $parts;

        if (!$file = FileModel::find((int) $id)) {
            throw new ApplicationException('File not found');
        }

        // Ensure that the file model utilized for this request is
        // the one specified in the relationship configuration
        if ($file->attachment) {
            $fileModel = $file->attachment->{$file->field}()->getRelated();

            // Only attempt to get file model through its assigned class
            // when the assigned class differs from the default one that
            // the file has already been loaded from
            if (get_class($file) !== get_class($fileModel)) {
                $file = $fileModel->find($file->id);
            }
        }

        $verifyCode = self::getUniqueCode($file);
        if ($code != $verifyCode) {
            throw new ApplicationException('Invalid hash');

View on GitHub (pinned to b608633a7e)

When it happens

Trigger: Thrown at modules/backend/controllers/Files.php:172 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of octobercms/october@b608633a7e (2026-08-21). Data as JSON: /api/errors/aab8979458a52e3d. Report an issue: GitHub.