Quantcast
Channel: Active questions tagged symfony4 - Stack Overflow
Viewing all articles
Browse latest Browse all 3917

EasyAdmin image path

$
0
0

I can't figure out how to display an image uploaded via EasyAdmin. When it uploads the image it displays an absolute path on the server and stores the whole thing together with the filename to the database, so it can't be used for the html <img> tag.

How can I store a relative path to the image instead? Or do I need to apply some filter in twig to display it?

I have an EasyAdmin form with a field:

- { property: 'imageFile', type: 'file_upload', type_options: { upload_dir: '/public/data/gallery/images/', upload_filename: '[uuid]-[timestamp].[extension]'}}

I am using an inbuilt EasyAdmin file uploader, not a separate Bundle or Service:https://symfony.com/doc/current/bundles/EasyAdminBundle/book/edit-new-configuration.html#file-upload


Viewing all articles
Browse latest Browse all 3917

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>