G
G
grabbee2017-02-10 23:23:14
symfony
grabbee, 2017-02-10 23:23:14

How to describe the router for image subfolders image/ab/cd/efg/abcdefg.png?

The usual situation is nested folders (from parts of the name) to store pictures not in a bunch image/ab/cd/efg/abcdefg.png - the picture may not be in place (thumbnail), then it needs to be made from the original, but it has a different name .. I need to get abcdefg.png and describe a type router for this

/**
     * @Route("/image/{name}")
     */

How to do it right?

Answer the question

In order to leave comments, you need to log in

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

as in the docks I made it possible to send name with a slash inside, the name is ab/cd/efg/abcdefg.png, then I shove this piece into the router to generate links. when a request comes to this address, nginx tries to return the image, and if it doesn’t find it, it proxies the request to api, but cuts the folder structure from the request. it turns out image/abcdefg.png - the same router @Route("/image/{name}")

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question