<?php
/*Skrypt pochodzi z ksi±¿ki "PHP. 101 praktycznych skryptów"
  autor: Marcin Lis                    http://marcinlis.com*/

$filePath = "/nazwa/katalogu";
$fileName = "nazwa.pliku";

$fd = fopen($filePath.$fileName,"r");
$size = filesize($filePath.$fileName);
$contents = fread($fd, filesize($filePath.$fileName));

fclose($fd);

header("Content-Type: application/octet-stream");
header("Content-Length: $size;");
header("Content-Disposition: attachment; filename=$fileName");

echo $contents;
?>
