Is there any way to download sqlite database file by admin user of application

I want my app’s admin user be able to download sqlite database file located in protected/data directory. How is that possible?

properly configured server should deny access to protected directory.

Thus I’d try adding following action to the controller:




public function actionDownloadSqlite(){

// check access here somehow!!

header("Content-type: application/octet-stream");

echo file_get_contents(Yii::app()->basePath."/data/sqlite.db");

Yii::app()->end();

}

This doesn’t work, it show this error:

Error 6 (net::ERR_FILE_NOT_FOUND): The file or directory could not be found.

it sounds like Chrome’s 404 page.

Most likely you’ve entered wrong url