Forum Moderators: coopster
I would like it to be similar to the process you see on most poker websites today. A user clicks a download button on the home page, the open/save dialog box opens in the browser, then the browser redirects to the download instructions page.
It could also work the other way around. The user clicks the button which takes them to the download page, then the file is a forced download. I'm not really bothered which way it works. Whichever is the most usable for the end user I guess.
If anyone could point me in the right direction I would really appreciate it.
Thanks in advance.
Chris.
London, UK.
It should be pretty basic but can be ramped up a little.
I would have the actual file saved outside the webroot then when someone clicks the download now button they are taken to a user agreement and download instructions page. Have another link and when it is clicked read the file and dump it to the browser.
I don't know what the file type is but I use something like this to generate a csv on the fly and dump out to the brosers for download
$out = strlen($file_out);
if (isset($file_out)) {
header("Content-Length: $out");
header("Content-type: application/csv");
header("Content-Disposition: attachment; filename=$filename");
echo $file_out;
exit;
}