I have code which downloads a picture from a fake link. I have looked at others comments / sites but nothing has helped me find the solution to the annoying :
“Failed to load resource: Frame load interrupted”
my php headers are after I read the GET value:
header("Pragma: public"); // required
header("Expires: 0");
header("Cache-Control: private",false); // required for certain browsers
//header('Content-Length: '. @filesize($id));
header('Content-Type: '.$mim);
header('Content-Disposition: attachment; filename="'.$date.basename($fileName).'"');
header('Content-Transfer-Encoding: binary');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
readfile($fileName);
and I have jQuery script which calls an iframe to download the file:
$('body').append('<iframe class="download" src="download.php?id='+downloading+'" style="visibility:hidden;" width="0" height="0"></iframe>');
I downloads the file correctly, but shows an error in the console, please let me know if its fixable??
This will work 😉