PDF downloaded without .pdf file extension in Chrome – Phoca PDF 5.2.1 / Joomla 5

Phoca PDF - creating PDF documents in Joomla! CMS
FlorianSch
Phoca Member
Phoca Member
Posts: 11
Joined: 09 Oct 2017, 21:46

PDF downloaded without .pdf file extension in Chrome – Phoca PDF 5.2.1 / Joomla 5

Post by FlorianSch »

Hello Jan,

I am experiencing an issue with Phoca PDF on our Joomla website and would appreciate your advice.

We use Phoca PDF 5.2.1 with Joomla 5.4.x to generate PDF versions of our artist biographies.

Example URL:
https://www.ks-gasteig.de/index.php/de/ ... format=pdf

The issue:
  • In Chrome on macOS, the generated PDF is downloaded without a `.pdf` file extension.
  • If I manually add `.pdf` to the downloaded filename, the file opens correctly as a PDF.
  • In Safari and Firefox, the download appears to work correctly.
  • Another colleague has experienced the same issue.
I have checked the relevant Phoca PDF code. In `libraries/src/Document/PdfDocument.php`, the response header is set as follows:

Factory::getApplication()->setHeader(
'Content-disposition',
'inline; filename="'.$this->getName().'.pdf"',
true
);


The PDF itself is generated through TCPDF in `administrator/components/com_phocapdf/helpers/phocapdfrender.php`.

At this stage, I have not been able to determine whether the issue is caused by the response headers, the interaction with Joomla, or Chrome's handling of the response.

Could you advise how best to diagnose this, and whether this might be a compatibility issue with the current Phoca PDF version?

I have not modified any of the PHP files.

Thank you for your help.

Best regards
Florian
gwhitlock64
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 18 Oct 2026, 08:47

Re: PDF downloaded without .pdf file extension in Chrome – Phoca PDF 5.2.1 / Joomla 5

Post by gwhitlock64 »

Not a Phoca expert, but that header looks fine on paper... so I'm wondering what Chrome is actually receiving. Has anyone checked the raw response in DevTools (Network tab) to see if the Content-Disposition header survives intact, or if Joomla, a cache or the server config is mangling it or sending a different Content-Type? Also, does it still happen in an incognito window with extensions off? Chrome on a Mac can be a bit wierd about that stuff, to be fair. Cheers 🙂
FlorianSch
Phoca Member
Phoca Member
Posts: 11
Joined: 09 Oct 2017, 21:46

Re: PDF downloaded without .pdf file extension in Chrome – Phoca PDF 5.2.1 / Joomla 5

Post by FlorianSch »

Hi,

I have now checked the actual response headers in Chrome DevTools, and I found something interesting.

For this URL:
https://www.ks-gasteig.de/index.php/de/ ... format=pdf

Chrome receives these response headers:


Content-Disposition: attachment; filename="Biografie%20–%20Juliane%20Banse%2C%20Sopran"
filename*=UTF-8''Biografie%20–%20Juliane%20Banse%2C%20Sopran
Content-Type: application/pdf


Both filename parameters lack the `.pdf` extension, although `PdfDocument.php` sets a `Content-Disposition` header with `.pdf`.

The response is HTTP 200, and the PDF itself is valid. Chrome downloads it without an extension, whereas Safari and Firefox work correctly.

Could TCPDF's `$pdf->Output()` be overriding the header set by `PdfDocument.php`? What would you recommend as the correct fix?

Thanks!
Post Reply