php - Start download automatically when a user navigates to another page -
i wondering how accomplish effect i've seen on several websites, click download link, takes me page, , download starts automatically. best way accomplish this?
redirect page emits following headers:
header("content-disposition: attachment; filename=$filename"); header("content-length: $length");
see this post restrictions on $filename
.
edit in response andr's answer, php equivalent of redirect-after-x-seconds be:
header("refresh: 2; url=start_download.php");
(although should officially specify complete url, think) start_download.php contain 2 lines above.
Comments
Post a Comment