Force download script
Moderator: General Moderators
-
shubham_amola
- Forum Newbie
- Posts: 5
- Joined: Thu Oct 16, 2008 8:09 am
Force download script
i want to force a file to download instead of opening it in browser or acrobat...ny advice????
Re: Force download script
If $filename is the path to the file you want downloaded:
Code: Select all
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=" . basename($filename));
readfile($filename);
exit;