Add Script to WP for beginning download afile after 5 seconds

6 replies
I make a website with WP to distribute a file, I want any kind of script that when user click a link of download, a new page open then begin download file after 5 or 10 seconds. Thank you in advance.
#add #afile #beginning #download #script #seconds #wordpress
  • Profile picture of the author RaulK
    I don't know if there's a WP plugin for this, but if you know some coding, you can use Meta refresh to accomplish this. Something like:
    <meta http-equiv="refresh" content="5;url=http://yourwebsite.com/">
    5 is the number of seconds.
    {{ DiscussionBoard.errors[3083721].message }}
    • Profile picture of the author mystline
      Originally Posted by RaulK View Post

      I don't know if there's a WP plugin for this, but if you know some coding, you can use Meta refresh to accomplish this. Something like:
      <meta http-equiv="refresh" content="5;url=http://yourwebsite.com/">
      5 is the number of seconds.
      To bind this to a button you could just create that element using some JS, or use window.location
      {{ DiscussionBoard.errors[3087331].message }}
      • Profile picture of the author anestbaik
        and the complete code are ->

        file link-download.html
        <!-- this is link to click that will show the new window for download file -->
        <a href="http://your-domain.com/your-file-download.html">CLICK HERE TO DOWNLOAD</a>


        file your-file-download.html
        <html>
        <head>
        <script type="text/javascript" src="./jquery.js"></script>
        </head>
        <body>
        Thank you for downloading,
        wait 10 second,
        see this ADS

        <script>
        $(window).load(function () {
        setTimeout(function() {
        alert('Dowload BEGIN');
        }, 10000);
        });
        </script>

        </body>
        </html>
        {{ DiscussionBoard.errors[3088837].message }}
        • Profile picture of the author sanju9999
          Hello Sir anestbaik
          Im not able to do this on my website. Please can u upload video on youtube for this "Add Script to WP for beginning download afile after 5 seconds" tutorial ?
          I am also interesting for your service for wordpress clone theme. And for this I am agree to pay your charges. Please reply me as soon as possible.
          My Email is : patelsanjay99@hotmail.com
          {{ DiscussionBoard.errors[8460751].message }}
        • Profile picture of the author sanju9999
          Originally Posted by anestbaik View Post

          and the complete code are ->

          file link-download.html
          <!-- this is link to click that will show the new window for download file -->
          <a href="http://your-domain.com/your-file-download.html">CLICK HERE TO DOWNLOAD</a>


          file your-file-download.html
          <html>
          <head>
          <script type="text/javascript" src="./jquery.js"></script>
          </head>
          <body>
          Thank you for downloading,
          wait 10 second,
          see this ADS

          <script>
          $(window).load(function () {
          setTimeout(function() {
          alert('Dowload BEGIN');
          }, 10000);
          });
          </script>

          </body>
          </html>
          Hello anestbaik

          I want to create downloading link should open in new download page with 5 second limit and advertisement. The demo site is : Download Notebook Drivers, Software, Manuals.
          I want create this tutorial on my website : A website about download drivers, software update, hardware. So how can i do this? Please help me.
          Thanks in advance.
          {{ DiscussionBoard.errors[8460761].message }}
  • Profile picture of the author brian culbert
    Thank you all guys for your precious help, It runs like magic. Thank you, Thank you, Thank you


    {{ DiscussionBoard.errors[3091563].message }}

Trending Topics