download script?
Posted: Sun Jan 22, 2006 6:44 am
How do you create a download script that like masks where the file is coming from
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
<?php
$path_to_file = '/home/username/private/foo.pdf';
header('Content-type: application/pdf');
header('Content-length: '.filesize($path_to_file));
header('Content-disposition: attachment; filename=foo.pdf');
fread($path_to_file);
exit();
?>*cough*
You were only testing him, eh?d11wtq wrote:/me awards feyd the prize jar of ross' pickled onions for spotting the deliberate mistake