topical media & game development

talk show tell print

professional-sql-07-public-files-admin-download.php / php



  <?php
  include '../../lib/common.php';
  include '../../lib/config.php';
  
  dir = _GET['dir'];
  file = _GET['file'];
  
  target = BASEDIR . dir . '/' . file;
  
  if (file_exists(target) && is_file(target))
  {
      header('Content-Type: application/force-download');
      header('Content-Disposition: attachment; filename="' . file . '";');
      header('Content-Transfer-Encoding: binary');
      header('Content-Length: ' . filesize(target));
      readfile(target);
  }
  ?>
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.