Redirect in listener
Hello, I'm making a custom listener to download a PDF when someone clicks on a button.
The PDF gets generated on a URL so I want to redirect the user to the url when they click on the button. But it doesn't work.
This is the current code:
4 Replies
listeners cant return like that unfortunately
as there might be multiple listeners for the same event
cant you just do this in javascript since you can pass the pdf url to that in the view
Yeah that should be possible too
Thanks
You should be able to register a form action and return a StreamResponse that will download the file. I’m doing that in Curator.
Thanks for the tip 🙂