Downloading Zip File Using Js Window.open _self Without "useless Window"
Following information from this page where the issue of the 'useless empty window' is discussed, I'm trying to create a script that starts the download of a zip file:
Solution 1:
You can use a hidden iframe instead. The window.open will clear all your page content when using _self.
Here is a quick example
<ahref="archive.zip"target="download_frame">Initiate download from link</a><iframeid="download_frame"name="download_frame"src="about:Blank"style="width:0px; height:0px; overflow:hidden;"frameborder="0"scrolling="no"></iframe><scripttype="text/javascript">// initiate download by script// add this in onload event or after the iframedocument.getElementById('download_frame').src="archive.zip";
</script>
Post a Comment for "Downloading Zip File Using Js Window.open _self Without "useless Window""