public function deleteModel($id)
    {
        if (($model = $this->loadModel($id)) === null) {
            throw new CException(sprintf('Failed to locate file model with id "%d".', $id));
        }
        $filePath = $model->resolvePath();
        if (file_exists($filePath) && !unlink($filePath)) {
            throw new CException('Failed to delete the file.');
        }
        if (!$model->delete()) {
            throw new CException('Failed to delete the file model.');
        }
        return true;
    }