symfony-assetmapper

AssetMapper and File Upload


with Symfony 7, I'm using AssetMapper. So my image files are located in assets/images.

In production, I build them with a little php bin/console asset-map:compile and life is beautiful.

But what should I do when my admin uploads a file via the back office in production?

Today, I run the command php bin/console asset-map:compile via the controller that manages the file upload so that, with each image upload, the assets are built.

But is this the right practice? Is there a different way to do it and if so, have you found it?

Thanks in advance :)


Solution

  • I found the answer : in /assets leaves all assets that serves our website and can be compiled.

    To work with upload, we just have to set files into /public as usual.