<?php
  ///////////////////////////////////////////////////
  //Передача файла
  //2010 (C)
  //Карпухин Павел
  ///////////////////////////////////////////////////

  if(strlen($_GET['trans'])>100) {echo "<p align='center'>".$TEXT['error-exp1']."</p>";}

  $filename = substr($_GET['trans'], 8,200);
  $len = filesize($_GET['trans']);
  header("Pragma: public");
  header("Expires: 0");
  header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
  header("Cache-Control: public"); 
  header("Content-Description: File Transfer");
  header("Content-Type: application/octet-stream");
  header("Content-Disposition: attachment; filename=$filename;");
  header("Content-Transfer-Encoding: binary");
  header("Content-Length: ".$len);
  readfile($_GET['trans']);
  unlink($_GET['trans']);
?>