Hi,
I have a script that writes a cookie on a user's machine before returning a (large) file to download.
The current version looks like this:
<?php
setcookie('cookie', 'value', time() + 315360000, '/', '.mydomain.com', 0);
header("Location: [url]http://www.mydomain.com/file.exe[/url]");
exit;
?>
This works great but I would like to avoid the browser roundtrip created by the redirect.
I know that I can use the readfile function but since the files I am returning are very large I do not want the php engine to be running all that time for a single download, nor the engine to timeout.
Do you have any suggestion on how to handle this? (my web server is Apache.)
Thanks,
/phil