bonjour
je suis debutant dans le symfony
j'ai un formulaire qui contient un input file
qaund je fais la création tt vas bien
mais quand je veux editer ma entité
je reçoi cette erreur quand j'accede a la page

The form's view data is expected to be an instance of class Symfony\Component\HttpFoundation\File\File, but is a(n) string. You can avoid this error by setting the "data_class" option to null or by adding a view transformer that transforms a(n) string to an instance of Symfony\Component\HttpFoundation\File\File.

merci pour l'aide

2 réponses


Bonjour,

Peux-tu nous montrer ton code pour voir si il y a un problème ?

Merci

Bonjour,

Tu doit indiqué dans ton <form> que le formulaire contient l'envoi de fichier avec (enctype="multipart/form-data")