Auto Start download File using javascript and Jquery

 This is one of the simple concept to start download the particular file automatically without click any link. You can also set the timings, To download the file after some time. In Below example i given 2 seconds, So after two seconds it downloads the file automatically, You can set the time according to your choice. This will done by using simple javascript and jquery. Below is the full code and live demo. I hope this will useful.

Code for Auto download File using Jquery:

<title>Start Auto Download file</title>
<script src=""></script>
$(function() {
var $this = $(this);
setTimeout(function() {
window.location = $this.attr('href');
}, 2000);
<div class="wrapper">
<p>The download should start shortly. If it doesn't, click
<a data-auto-download href="">here</a>.</p>

Post a Comment


  1. nice piece, thanks and continue with your great tuttorials

  2. What do you add for it to open in a new window?