I have this:
html:
<form action="myfile.php" enctype="multipart/form-data" target="ifr1" method="post">
...form stuff...
</form
<iframe name="ifr1" id="ifr1" onload="console.log('loaded')"></iframe>
The php file contains these headers:
header('Content-type: application/pdf');
header('Cache-Control: private, must-revalidate, post-check=0, pre-check=0, max-age=1');
header('Content-Transfer-Encoding: binary');
header('Content-Length: ' . filesize($out_filename));
header('Content-Disposition: attachment; filename="' . $pdf_filename . '"');
@readfile($out_filename);
When the php loads and I get the dialog box to download the pdf, the onload event on the iframe does NOT fire. Is there any way to have the front end detect when the php file has completed and the pdf file is ready?