Reputation: 156
I have a very similar problem to How to rename PDF in primefaces media tag
However, I'm using Primefaces 7.0 so it can't be the bug that got fixed with 6.1, nor am I forgetting to set the name by myself. I've read about Chrome having changed something (deliberately or not) so that we can't set the displayed name anymore. Anyone having more infos or some workaround?
Greetings
Upvotes: 0
Views: 1761
Reputation: 12019
The use of p:media
for PDF's has been a hack over the years and the browser keep changing. That filename trick for PDF's use to work then it stopped working when Chrome made some changes.
See this ticket: https://github.com/primefaces/primefaces/issues/5901
PrimeFaces has deprecated use of PDF in Media for 11.0. If you really want to render PDF's and be able to download with a proper name I suggest checking out PrimeFaces Extensions DocumentViewer: https://www.primefaces.org/showcase-ext/sections/documentviewer/basic.jsf
However Chrome 92 recently made a change that broke it we had to fix you can read about here: https://github.com/primefaces-extensions/primefaces-extensions/issues/122
Upvotes: 3