We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

open a pdf file in the folder public

Hello, I you make reports in pdf using a library that created the file, and then opened in the browser with the following code

echo "<script language='javascript'>window.open('listageneralusuarios.pdf','_self','');</script>";//para ver el archivo pdf generado

But the file is created in the public folder and have the following error message

Action 'listageneralusuarios.pdf' was not found on handler 'spt_encabezado'

How do I open the PDF file in the browser?



58.3k

Hello

First you need go to the url https://youwebsite/istageneralusuarios.pdf, is have exist and then edit your code

window.open('listageneralusuarios.pdf','_self','')

Tobe

window.open('/listageneralusuarios.pdf','_self','')


81.1k

If there was created in the public folder

Hello

First you need go to the url https://youwebsite/istageneralusuarios.pdf, is have exist and then edit your code

window.open('listageneralusuarios.pdf','_self','')

Tobe

window.open('/listageneralusuarios.pdf','_self','')