Open HaisRodolphe opened 3 years ago
Hello, i have the same problems.
Open the file :
EasyCorp\Bundle\EasyAdminBundle\ Form\Type\ FileUploadType.php
Go to line 161 to 163 and comment it.
/* if (0 !== mb_strpos($value, \DIRECTORY_SEPARATOR)) {
$value = $this->projectDir.'/'.$value;
}
*/
It's work.
Hello, Yes, I have commented on line 161 to 163. But the problem persists. Thank you in advance for your answers
Hello i have the same problem ant this error
An error has occurred resolving the options of the form "EasyCorp\Bundle\EasyAdminBundle\Form\Type\FileUploadType": Invalid upload directory "C:\Users\alexa\Documents\AAA_projet\Projet\laboutiqueinformatique/C:\Users\alexa\Documents\AAA_projet\Projet\laboutiqueinformatique\public/uploads\" it does not exist or is not writable.
i need to comment line 161 to 163. of this file EasyCorp\Bundle\EasyAdminBundle\ Form\Type\ FileUploadType.php
BUT it didn't solve the problem fully.
Je pense que vous êtes des français, vue le nom "laboutiquefrancaise, laboutiqueinformatique" J'ai une autre solution pour vous afin d'éviter de commenter les lignes.
Allez-y dans votre CRUD CONTROLLER de produit :
ImageField::new('illustration') ->setBasePath('uploads') ->setUploadDir('public/uploads') // ICI QUE VOUS DEVEZ REMONTER VOS DOSSIERS ->setUploadedFileNamePattern('[randomhash].[extension]') ->setRequired(false),
Par exemple pour le cas de alexandre-leng :
An error has occurred resolving the options of the form "EasyCorp\Bundle\EasyAdminBundle\Form\Type\FileUploadType": Invalid upload directory "C:\Users\alexa\Documents\AAA_projet\Projet\laboutiqueinformatique/C:\Users\alexa\Documents\AAA_projet\Projet\laboutiqueinformatique\public/uploads\" it does not exist or is not writable.
Tu dois ici remonter jusqu'à ton dossier original qui est donc laboutiqueinformatique avant le "C:\Users.." Donc à partir de \public/ tu remonte, ça devrait te faire 7 dossier à remonter, essaye de tester. Du coup ça donne :
ImageField::new('illustration') ->setBasePath('uploads') ->setUploadDir('../../../../../../../public/uploads') ->setUploadedFileNamePattern('[randomhash].[extension]') ->setRequired(false),
Thank you very much for your help, I just found it. It binds it to windows 10 and folder protection. I want to thank you for your help.
hi, i have the same issue on my dedicated server.
An error has occurred resolving the options of the form "EasyCorp\Bundle\EasyAdminBundle\Form\Type\FileUploadType": Invalid upload directory "/var/www/myappname/public/uploads/" it does not exist or is not writable.
this is my script from ProductCrudControll :
ImageField::new('illustration') ->setBasePath('uploads') ->setUploadDir('public/uploads')
The problem is that my folder 'uploads' located in /var/www/myappname/public/upload/ exist, i don't understand why symfony can't go to this folder using this route.
If anybody can tell me what i am doing wrong, it would be nice.
Thank you
Describe the bug An error occurred while resolving the options of the form "EasyCorp \ Bundle \ EasyAdminBundle \ Form \ Type \ FileUploadType": Invalid upload directory "C: \ laragon \ www \ e-commerce symfony \ laboutiquefrancaise \ laboutiquefrancaise / public / uploads \ "it does not exist or is not writable.
Software laragon. coding: ImageField::new('illustration') ->setBasePath('uploads/') ->setUploadDir('public/uploads') ->setUploadedFileNamePattern('[randomhash].[extension]') ->setRequired(false), thank you so much Icône de validation par la communauté Validée