Search code examples
phpsymfony4

Symfony 4 "Easy admin" upload directory does not change when "upload_dir" option is used


I have some troubles on the bundle easy_admin in Symfony 4.3

I do not find where the upload directory is defined by the bundle. He still uses the default configuration even if I define my upload_dir option in the field.

My configuration

easy_admin:
  entities:
    Images:
      new:
        fields:
          - { property: 'name', type: 'file_upload', upload_dir: 'uploads/images/', download_path: 'uploads/images/', allow_add: true, type_option: { multiple: true }}

The error message

Invalid upload directory "C:\Users\My\Desktop\Project/C:\Users\My\Desktop\Project/public/uploads/files/\" it does not exist or is not writable.

Thank's for the help.


Solution

  • After some struggling i found out that

    - { property: 'file', type: 'file_upload', type_options: { upload_dir: 'public/another_folder/' } }
    

    actually works