Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8053125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:45:10+00:00 2026-06-05T07:45:10+00:00

I am currently making a temporary download page for website visitor. The page includes

  • 0

I am currently making a temporary download page for website visitor.

The page includes a form, after the visitor fills the form up, the site will take them to the pdf download page.

In the download page, there are some pdf files download links (I am just using a tag.). However, i wanna make a onclick event to those links, once they have been clicked, the page will refresh automatically or redirect to other pages.

<a href="/file.pdf" onClick="window.location.reload()">The File</a>

I have tried the jquery way as well.

<a href="/file.pdf" id="FileDownload">The File</a>
<script>
   $("#FileDownload").click(function(){
         location.reload();
   });
</script>

But all the them are not working. Do you masters have any good ideas about this, many thanks.

P.S. What if I wanna add a countdown after a file is being started download, and then do page reload when countdown finishes.

Looks like have asked several questions… Thanks a ton in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T07:45:12+00:00Added an answer on June 5, 2026 at 7:45 am

    This works:

    http://jsbin.com/imikit/5

    The timeout must be set to more than the response time of the server serving the file, otherwise the javascript won’t fire. So set it to something high.

    <a href="http://ipv4.download.thinkbroadband.com/1GB.zip" id="download">The File</a>
    
    $('#download').click(function() {
      setTimeout(function() {
        window.location = 'http://www.google.com/';
      }, 1000);
    });
    

    Or

    <a href="http://ipv4.download.thinkbroadband.com/1GB.zip" id="download" target="_blank">The File</a>
    
    $('#download').click(function() {
      window.location = 'http://www.google.com/';
    });
    

    Most browsers will close the newly opened window once the download has initiated.


    Lighttpd 2’s mod_upload might be worth looking at. Unfortunately there’s no stable version of Lighttpd 2 yet.


    You could try sending a cookie along with the download, then detecting it with javascript. This will either be set after the headers are sent, or after the body is sent. (test it)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently making a website that includes a menu navigation almost identical to
I'm currently making some system that will gather statistical reports from different sites, for
Hi i am currently making a demo site from just pure html/css/javascript usually i
Im currently making a firefox extension that will let you choose what tabs you
I am currently making a rails app that will search #barcampmlk2 #{thesessionname} +1 from
I am currently making an ASP.Net and C# page, which is a front end
I'm currently making a website where the owners want background ads (a ad as
Im currently making a very simple WebApp on a Website using ASP.NET Framework using
I'm currently making a graphical application, and it will make my life a lot
I am currently making some Acceptance-Tests that will help drive the design of a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.