<?php
  
  require_once('classes/conf.php');
  include("classes/header.php");
  
if ($_FILES["file"]["type"] == 'text/plain'){

  if ($_FILES["file"]["error"] > 0)
    {
    echo "Return Code: " . $_FILES["file"]["error"] . "<br />";
    }
  else
    {
    echo "Upload: " . $_FILES["file"]["name"] . "<br />";
    echo "Type: " . $_FILES["file"]["type"] . "<br />";
    echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
      move_uploaded_file($_FILES["file"]["tmp_name"],
      MAP_LOCATION . $_FILES["file"]["name"]);
      rename(MAP_LOCATION . $_FILES["file"]["name"], MAP_LOCATION . strip_tags($_POST["package"]) . strip_tags($_POST["build"]));
      }
  }
  else
  {
  echo "Invalid file";
  }
include("classes/footer.php");
?>
