<?php
$id=$_GET['name'];
if(file_exists($id)){

// Imagenes gif

if(eregi("gif", $id)){

Header("Pragma: public");

Header("Expires: 0");

Header("Cache-Control: must-revalidate, post-check=0, pre-check=0");

Header("Content-Type: application/force-download");

Header("Content-type: image/gif");

Header("Content-Type: application/download");

Header("Content-Disposition: attachment; filename='".$id."'");

Header("Content-Transfer-Encoding: binary");

Header("Content-Length: ".filesize($id));

@readfile($archivo);

// Imagenes jpg

} elseif(eregi("jpg", $id)){

Header("Pragma: public");

Header("Expires: 0");

Header("Cache-Control: must-revalidate, post-check=0, pre-check=0");

Header("Content-Type: application/force-download");

Header("Content-type: image/jpeg");

Header("Content-Type: application/download");

Header("Content-Disposition: attachment; filename='".$id."'");

Header("Content-Transfer-Encoding: binary");

Header("Content-Length: ".filesize($id));

@readfile($id);

// exe

} elseif(eregi("exe", $id)){

Header("Pragma: public");

Header("Expires: 0");

Header("Cache-Control: must-revalidate, post-check=0, pre-check=0");

Header("Content-Type: application/force-download");

Header("Content-Type: application/x-msdownload ");

Header("Content-Disposition: attachment; filename=".$id);

Header("Content-Transfer-Encoding: binary");

Header("Content-Length: ".filesize($id));

@readfile($id);

// HTML

} elseif(eregi("html", $id)){

Header("Pragma: public");

Header("Expires: 0");

Header("Cache-Control: must-revalidate, post-check=0, pre-check=0");

Header("Content-Type: application/force-download");

Header("Content-Type: application/download");

Header("Content-Disposition: attachment; filename='".$id."'");

Header("Content-Transfer-Encoding: binary");

Header("Content-Length: ".filesize($id));

@readfile($id);

// General

} elseif(eregi(".", $id)){

Header("Pragma: public");

Header("Expires: 0");

Header("Cache-Control: must-revalidate, post-check=0, pre-check=0");

Header("Content-Type: application/force-download");

Header("Content-Type: application/download");

Header("Content-Disposition: attachment; filename=".$id);

Header("Content-Transfer-Encoding: binary");

Header("Content-Length: ".filesize($id));

@readfile($id);

// Imagenes png

} elseif(eregi("png", $id)){

Header("Pragma: public");

Header("Expires: 0");

Header("Cache-Control: must-revalidate, post-check=0, pre-check=0");

Header("Content-Type: application/force-download");

Header("Content-type: image/png");

Header("Content-Type: application/download");

Header("Content-Disposition: attachment; filename='".$id."'");

Header("Content-Transfer-Encoding: binary");

Header("Content-Length: ".filesize($id));

}

}

?>
