[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/se3-ocs/sources/www/ -> download.php (source)

   1  <?
   2  //====================================================================================
   3  // OCS INVENTORY REPORTS
   4  // Copyleft Pierre LEMMET 2005
   5  // Web: http://ocsinventory.sourceforge.net
   6  //
   7  // This code is open source and may be copied and modified as long as the source
   8  // code is always made freely available.
   9  // Please refer to the General Public Licence http://www.gnu.org/ or Licence.txt
  10  //====================================================================================
  11  //Modified on 12/07/2005
  12  include ("preferences.php");
  13  
  14  if($_GET["o"]&&$_GET["v"]&&$_GET["n"]&&$_GET["dl"])
  15  {
  16      $dlQuery="SELECT content FROM ";
  17      if( $_GET["n"] == "ocsagent.exe" ) {
  18          $dlQuery .= "deploy WHERE name='".$_GET["n"]."'";
  19          $fname = "ocsagent.exe";
  20      }
  21      else {
  22          $dlQuery .= "files WHERE name='".$_GET["n"]."' AND os='".$_GET["o"]."' AND version='".$_GET["v"]."'";
  23          if($_GET["o"]=="windows")
  24          {
  25              $ext="zip";
  26          }
  27          else if($_GET["n"]=="agent")
  28          {
  29              $ext="";
  30          }    
  31          else
  32          {
  33              $ext="pl";
  34          }
  35          $fname=$_GET["o"]."_".$_GET["n"]."_".$_GET["v"].".".$ext;
  36      }    
  37      
  38      $result=mysql_query($dlQuery, $_SESSION["readServer"]) or die(mysql_error($_SESSION["readServer"]));
  39      $cont=mysql_fetch_array($result);
  40  
  41      header("Pragma: public");
  42      header("Expires: 0");
  43      header("Cache-control: must-revalidate, post-check=0, pre-check=0");
  44      header("Cache-control: private", false);
  45      header("Content-type: application/force-download");
  46      header("Content-Disposition: attachment; filename=\"$fname\"");
  47      header("Content-Transfer-Encoding: binary");
  48      header("Content-Length: ".strlen($cont["content"]));
  49      echo $cont["content"];
  50  }
  51  
  52  
  53  
  54  ?>


Generated: Tue Mar 17 22:47:18 2015 Cross-referenced by PHPXref 0.7.1