set_time_limit(0); include("inclus/comunes.php"); if($_GET["download"] != "") { $fichero = str_replace("/", "", $_GET["download"]); if(file_exists(BASE."readymade/$fichero")) { $parts = explode(".", $fichero); $extension = $parts[sizeof($parts)-1]; header("Expires: 0"); header("Cache-control: private"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header('Content-type: application/'.$extension); header('Content-Disposition: attachment; filename="'.$fichero.'"'); readfile(BASE."readymade/$fichero"); exit(); } header("Location: /readymade.php"); exit(); } if($_GET["delete"] != "") { $fichero = str_replace("/", "", $_GET["delete"]); if(file_exists(BASE."readymade/$fichero")) { unlink(BASE."readymade/$fichero"); } header("Location: /readymade.php"); exit(); } if($_FILES["fichero"]) { foreach($_FILES["fichero"]["tmp_name"] as $k=>$v) { move_uploaded_file($_FILES["fichero"]["tmp_name"][$k], BASE."readymade/".$_FILES["fichero"]["name"][$k]); } header("Location: /readymade.php"); exit(); } $ficheros = array(); foreach(glob(BASE."readymade/*") as $fichero) { if(!is_dir($fichero)) { $ficheros[basename($fichero)] = filemtime($fichero); } } ksort($ficheros); ?>
| echo $fichero; ?> | (Uploaded echo date('H:i d/m/Y', $fecha); ?>) | [Delete] |