Skip to content
Advertisement

VichUploaderBundle in Symfony 6

I hope you can help me because i’m searching and i’m lost 🙁

I’m trying to upload image in my symfony 6 project with VichUploaderBundle.

I used the doc : https://github.com/dustin10/VichUploaderBundle/blob/master/docs/usage.md#step-1-configure-an-upload-mapping

But i have this error :

The class “AppEntityClient” is not uploadable. If you use annotations to configure VichUploaderBundle, you probably just forgot to add @VichUploadable on top of your entity. If you don’t use annotations, check that the configuration files are in the right place. In both cases, clearing the cache can also solve the issue.

My vich_uploader.yaml :

JavaScript

My Client Entity :

JavaScript

My FormType :

JavaScript

In my form twig :

JavaScript

Anybody can explain what’s going on ? 🙁

Advertisement

Answer

Assuming you are using Php 8+ configure the bundle to use attributes instead of annotations

JavaScript

ref docs

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement