Thread: Downloads
View Single Post
Old 12-28-2006, 07:49 AM   #2 (permalink)
DJMaze
Senior Contributor
 
DJMaze's Avatar
 
Join Date: Mar 2005
Posts: 733
DJMaze is on a distinguished road
yes, by sending the proper headers and then the data.

PHP Code:
$fp fopen('filename.tgz');
if (
$fp)
{
  
header('Content-Type: application/octet-stream; name="filename.tgz"');
  
header('Content-Length: '.filesize('filename.tgz'));
  
header('Content-Disposition: attachment; filename="filename.tgz"');
  
  
fpassthru($fp);
  
fclose($fp);

__________________

UT: Ultra-kill... God like!
DJMaze is offline   Reply With Quote