<?php
require_once "../core/configGeneral.php";
/* Get the name of the uploaded file */
$filename = $_FILES['file']['name'];

/* Choose where to save the uploaded file */
$sitio    = SERVERURL;
// $_SERVER['REQUEST_URI'];
$link         = $_SERVER['HTTP_HOST'];
$escaped_link = htmlspecialchars($link, ENT_QUOTES, 'UTF-8');
//Local
$location     = $escaped_link.$sitio."files/sastreria/fotos/".$filename;
//Servidor
//$location     = $sitio."files/sastreria/fotos/".$filename;

/* Save the uploaded file to the local filesystem */
if ( move_uploaded_file($_FILES['file']['tmp_name'], $location) ) { 
  echo '<script>  console.log("Success-"); </script>'; 
} else { 
  echo '<script>  console.log("Failure+"); </script>';
}

?>