G
G
grabbee2017-02-10 00:21:07
symfony
grabbee, 2017-02-10 00:21:07

How to make vich_uploader and liip_imagine friends so they can find each other?

vich_uploader is for uploading and it can store in a specific directory structure like year/month/day liip_imagine is for image processing. But he needs a path to the picture.
For the first one, you need to write a DirectoryNamer. And then how can everyone else look for downloaded files?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
grabbee, 2017-02-12
@grabbee

moved the namer to its own class. included it in DirectoryNamer for vich_uploader. you may also need to write a loader for liip_imagine and include the same class there as well. then I use it for hateoas, etc.

A
ak_wi, 2019-08-03
@ak_wi

In the latest version of vich_uploader you can use

vich_uploader:
    mappings:
        image_name:
            namer: Vich\UploaderBundle\Naming\SmartUniqueNamer

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question