I have a file, named download.php
, which contains a file to be downloaded, so it has the following headers (declared with PHP):
header(\"Content-Typ
I have a somewhat different proposal, which worked fine in my case and does not have an arbitrary timeout:
var newwindow = window.open("http://example.com/download.php");
newwindow.focus();
newwindow.onblur = function() {newwindow.close(); };
When finishing the download the new window will eventually unfocus and close.