dustin10/VichUploaderBundle

Using pure Annotation Does not Upload the actual file. @Vich\UploadableField

Closed this issue · 3 comments

Bug Report

Q A
Bundle version 2.3.1
Symfony version 5.4^
PHP version 8.1.2

Summary

Current behavior

Using pure @vich\Uploadable and @vich\UploadableField(mapping="images", fileNameProperty="url") Does not upload the temp file to the public/images directory.

And works if I add #[Vich\Uploadable] and #[Vich\UploadableField(mapping: 'images', fileNameProperty: 'url')] the annotation above

Use the attributes then

Use the attributes then

what happened to the annotation?
use Vich\UploaderBundle\Mapping\Annotation as Vich;

Since 2.0, you need to do this : the new default type for mapping is "attribute". You can still use annotations, but you need an explicit definition (set "annotation" as value for "vich_uploader.metadata.type" config key)