$dl_path = '/home/myweb/www/download/';
$filename = 'classes.pdf';
$file = $dl_path.$filename;
// then serve the file to the user
$data = file_get_contents( $file );
if ( $data === false )
{
echo '<div>Error: could not read file!</div>';
exit;
}
header('Content-type: application/pdf');
header("Content-disposition: attachment; filename=$filename" );
echo $data;
|