There's been a bunch of posts about using PHP to download files off the web. Except that they all deal with files that are in the web directory.
How can you download a file that's outside of the web directory in PHP. It should be possible with PHP's file handling stuff.
I've gotten a rudimentary version going. Where I open the file, set the headers, then stream the file to the browser.
header("Content-type: mime/special");
header("Content-Disposition: attachment; filename=$filename");
header("Content-Description: Laika Attachment");
header("Pragma: no-cache");
header("Expires: 0");
include ("/public/attachments/$filename");
Except, this needs to be done by opening a new window, that ends up having server error messages all over it. And now, I've recently found out that the file doesn't safely get there using Netscape on a Mac. (alhtough the file does seem to be getting there using Explorer on PC and Mac.)
Is there a better, or more elegant way of doing this?