Click here to Skip to main content
15,908,834 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a code on which there is some file which can be download. Now now i want to set a time duration after that duration download link will show to download a file..........

example: abc.pdf file which can be download. When user click on abc.pdf.then msg will show "wait for seconds " in that a time duration which already set is start eg: 5sec.after that 5sec download link will show click on that abc.pdf file will download.
Posted

 
Share this answer
 
Comments
rupal from india 13-Apr-13 4:36am    
thnxs for rply.......but i don't want to calculate to or find difference between time. my problem is that after completing particular seconds that was predefined, a link will show.....
include in HEAD section of HTML page this line:
HTML
<META HTTP-EQUIV='refresh' content='3; URL="downloadURL">


for example see my site http://catalogofsoftware.com/[^]

echo"<META HTTP-EQUIV='refresh' content='3; URL=".$row['Primary_Download_URL']."'>";
 
Share this answer
 
Just threw this together and believe it should work...

XML
<a href="javascript:download();">Download pdf</a>
<div id='link'></div>
<script>
i = 6;
j = 0;
function showLink()
{
    i--;
    if(i == 0)
    {
        document.getElementById("link").innerHTML = "<a href='#'>Whatever</a>";
        clearInterval(j);
    }
    else
    {
        document.getElementById("link").innerHTML = "Please wait for " + i + " seconds";
    }
}
function download(){
j = setInterval(showLink, 1000);
}
</script>
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900