Get File Path into database without upload

Hey all,

at the moment I am building an internal database-website for my company. For one entry we need to deposit a file path. The folder/file structure is already there so I just need the path+filename in the database without any upload-functionality.

Does anyone has an idea on how to implement the functionality?


it is better to store only filename in your database because when you change from local to server or from one server to another, path can change.

You can use Yii::$app->basePath.