Re: download script

From: Date: Tue, 10 Aug 2004 18:10:26 +0000
Subject: Re: download script
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-193344@lists.php.net to get a copy of this message
Aaron Todd wrote: <snip>
<?php $file = "/home/dlr/test/".$_GET['file'].""; if (file_exists(basename($file))) { header("Content-Description: File Transfer"); header("Content-Type: application/force-download"); header("Content-Disposition: attachment; filename=".basename($file)); @readfile($file); } else { echo "$file<br>"; echo basename($file); echo "<br>No File Found"; } ?>
Belay my last post...you're using readfile and not fread. Okay, what error is the script outputting? You should remove the '@' from in front of readfile() so that it will output an error if it's the problem. -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 john@kegworks.com

« previous php.general (#193344) next »