I am using the cookbook article from symfony.com to implement a file upload option for images.
Now I want to load up other images to the entity.
The default stra
The cookbook does not handle updates, in particular in the case where only the file changes.
In this case, the PreUpdate
event is not triggered, so you need to trigger $entity->preUpload()
manually before the $em->persist($entity)
, so that the file upload gets handled in any case (preUpload will alter $entity->path
so the persisting will occur)