huglester - 1 year ago


is there a way to set up default upload folder via config? For some modules, I would like to auto-create folders on install (for example), and if user picks to upload - it would automatically upload to folder like "cookiesforsale"

Thank you

ryanthompson - 1 year ago

If you define only 1 folder it will skip the selection of it - so in your case I think you could use a builder override to override the fields config on runtime.

    public function (ExampleFormBuilder $builder) {
            'upload_field' => [
                 'config' => [
                    'folders' => 'you_custom_folder'

Then you could add any custom logic to this you wanted - like defining the module's folder.