Hi,
I have an error with ImageField
Describe the bug
An error has occurred resolving the options of the form "EasyCorp\Bundle\EasyAdminBundle\Form\Type\FileUploadType": Invalid upload directory "C:\wamp64\www\myproject/C:\wamp64\www\myproject\public/uploads/files/\" it does not exist or is not writable.
To Reproduce
yield ImageField::new('image');
Thanks :)
Thanks for reporting!
This is "correct" because you are in edit/new and the Image field now allows to upload images, so you need to define the dir where images are uploaded. But ... the error message could be much better, so we're improving it in #3969.
Hi :).
I tested your Pull Request.
I then add ->setUploadDir(...)
yield ImageField::new('image')->setUploadDir('public/uploads/files');
But I still have the same error:
An error has occurred resolving the options of the form "EasyCorp\Bundle\EasyAdminBundle\Form\Type\FileUploadType": Invalid upload directory "C:\wamp64\www\myproject/C:\wamp64\www\myproject\public/uploads/files/" it does not exist or is not writable.
https://github.com/EasyCorp/EasyAdminBundle/blob/master/src/Form/Type/FileUploadType.php#L166
In error, there are 2 times the path C:\wamp64\www\myproject, and so if I delete the following lines it works: https://github.com/EasyCorp/EasyAdminBundle/blob/master/src/Form/Type/FileUploadType.php#L161-L163
Hope this can help you :)
Let's reopen because it seems that there's another bug.
I have the same error here
In error, there are 2 times the path
C:\wamp64\www\myproject, and so if I delete the following lines it works: https://github.com/EasyCorp/EasyAdminBundle/blob/master/src/Form/Type/FileUploadType.php#L161-L163
I have the same error but when I remove the lines like @seb-jean say, it's working
Most helpful comment
I have the same error here