I have a wordpress website.When a user clicks on a Button the download starts as the button is linked to a file.Now i need a way to redirect the user to a new page with some information and start the download automatically.
What is the best way to implement this?
One way of doing this.
First pass file by URL
<a href="download.php?url=file.txt">Download</a>
Delay download for few seconds and run the url in page download.php
Like:
$file = $_GET['url'];
echo 'Your download is srarting...';
sleep(5);
header('location: '.$file);