File/Media Manager

How to make possible of managing uploaded files?

Given a model, say "product", we can upload images and other files for it (2amigos/yii2-file-upload-widget or Nemmo/yii2-attachments).

But what if I want to select a file from server? How to do it?

By reading records from database.

I don’t see how reading from database would resolve this.

The question is in having a some kind of File Manager that would help in selecting files already uploaded on the server instead of uploading new ones and duplicating files.

Well, another option is to read directory contents via https://github.com/yiisoft/yii2/blob/master/framework/helpers/BaseFileHelper.php#L379

That is a better method.

Thanks.