How to define asset upload path


#1

I’m attempting to change the default upload path when adding an image to a Document, based on the path of the Document. I’m trying to understand the code under “Asset Upload Path” on this page: https://pimcore.com/docs/5.x/Development_Documentation/Extending_Pimcore/Event_API_and_Event_Manager.html, but I’m not sure where I would stick that code? I’ve played with listeners using the service.yml file, but haven’t tried dynamically adding listeners.