I’m using Tailor’s mediafinder to upload PDFs, and I want to change the default upload path for this specific module/blueprint and want the rest of them to use default as it was before, config is set to storage/app/media in filesystems.php. I’ve modified the configuration as follows:
'media' => [ // Default configuration
'driver' => 'local',
'root' => storage_path('app/media'),
'url' => '/storage/app/media',
'visibility' => 'public',
'throw' => false,
],
'tenders' => [ // Custom configuration for the new path
'driver' => 'local',
'root' => dirname(dirname(__DIR__)) . '/storage/app/media',// Path for tenders that i want to upload one directory above my October CMS directory.
'url' => 'http://127.0.0.1:8000/storage/app/media',
'visibility' => 'public',
'throw' => false,
],
At the moment, the mediafinder only supports storing files in one driver. We have plans to improve this in the future.
We could introduce an event that allows setting a custom driver inside file modules/media/classes/MediaLibrary.php and getStorageDisk method, however, it’s not clear how this could be used to swap the disk based on the Tailor blueprint.
probably good idea is, that use a some kind of option in yaml config, like destination, or uploadDirectory or something
gallery:
type: mediafinder
label: Gallery
mode: image
storage: media // default value, optional based on defined filesystem?
directory: downloads
for example, this configuration will use media filesystem, then default storage will be storage/app/media and directive for directory will upload file to storage/app/media/downloads
why not on model? i know, that currently “mediafinder” is without any database storage informations about files, but… probably, some kind of relation between filesystem and medialibrary will be helpfull in future, for storing metadata like source, exif, title, description, etc. not it is only filebrowser, right?
this will be helpfull for other use cases, like, when you wish to list different folders like s3, dropbox, etc. but, currently there are no “connectors” in mediafilder as well. but… still a perfect way how to prepare such a usefull funcionality