mam taki skrypt:
  1. <? 
  2. require ('func.php'); 
  3. $addir='admin'; 
  4. include ($addir.'/vars.php'); 
  5. include ($addir.'/config.php'); 
  6. if ($_SESSION['db']->connect($dbhost,$dbuser,$dbpasswd,$dbname)) { 
  7. $query = 'SELECT * FROM '.$prefix.'_downloads WHERE id=''.$id.'''; 
  8. if ($_SESSION['db']->query($query)) 
  9. $file = $_SESSION['db']->fetchArray(); 
  10. $file['num'] = $_SESSION['db']->numRows(); 
  11. $_SESSION['db']->close(); 
  12. } 
  13. if ($file['num']==1) { 
  14. if (!$file['path']) { 
  15. $file['path']=$updir."/".$file['name']; 
  16. $file['size']=filesize($file['path']); 
  17. } else $file['size']=filesize_remote($file['path']); 
  18. header("Content-Type: application/octet-stream"); 
  19. header("Content-Disposition: attachment; filename=".$file['name']); 
  20. header("Accept-Ranges: bytes"); 
  21. header("Content-Length: ".$file['size']); 
  22. header("Pragma: no-cache"); 
  23. header("Expires: 0"); 
  24. header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); 
  25. header("Content-transfer-encoding: binary"); 
  26. @readfile($file['path']); 
  27. exit(); 
  28. ?>


niestety kazdy plik jaki chce sciagnac przez ten skrypt dostaje rozszerzenie .php, nazwa jest dobra tylko to rozszerzenie. co jest nie tak ?
help