Ver Mensaje Individual
  #13 (permalink)  
Antiguo 05/04/2010, 10:52
Avatar de towel
towel
 
Fecha de Ingreso: marzo-2009
Mensajes: 101
Antigüedad: 15 años, 2 meses
Puntos: 0
Respuesta: header para IE

no es mas mirene l codigo completo de lapagina emergente.
Cita:
<?php
function partir_nombre($nombre)
{
$rutanombre = explode("/", $nombre);
$rutanombre1 = $rutanombre[0];
$rutanombre2 = $rutanombre[1];
$result = $rutanombre2;
return $result;
}
$nombreD = $_GET["nombreD"];

$nombreE = partir_nombre($nombreD);

$user_agent = strtolower ($_SERVER["HTTP_USER_AGENT"]);

if ((is_integer (strpos($user_agent, "msie"))) && (is_integer (strpos($user_agent, "win"))))
{


if (!isset($_GET['nombreD']) || empty($_GET['nombreD']))
{
exit();
}
$root = "/web/otbvideo/HTML_dowload/download_video/";
$file = $_GET['nombreD'];
$path = $root.$file;
$type = '';
if (is_file($path)) {
$size = filesize($path);
if (function_exists('mime_content_type'))
{
/*$path = basename($path);
echo $hola = mime_content_type("php.gif");
echo $hola2 = mime_content_type('test.php');
echo "resultado = ".$type = mime_content_type($path);*/
$type ="video/x-ms-wmv";
}
else if (function_exists('finfo_file'))
{
echo "hola2";
$info = finfo_open(FILEINFO_MIME);
$type = finfo_file($info, $path);
finfo_close($info);
}
if ($type == '') {
$type = "application/force-download";
}
// Set Headers
header("Content-Type: $type");
header("Content-Disposition: attachment; filename=$file");
header("Content-Transfer-Encoding: binary");
header("Content-Length: " . $size);
// Download File
readfile($path);
}
else
{
die("File not exist !!");
}

}
else
{
// echo "hola2";
header("Content-Description: File Transfer");
header('Content-Type: application/octet-stream');
header("Content-Type: application/force-download");
header("Content-Type: application/download");
header("Content-Transfer-Encoding: binary");
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Disposition: attachment; filename=".$nombreE." ");
//readfile("/Server/www/download/download_video/".$nombreD." ");*/
readfile("/web/otbvideo/HTML_dowload/download_video/".$nombreD."");
}




/*header ("Content-Disposition: attachment; filename=".$release." ");
header ("Content-Type: application/octet-stream");

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

header("Content-Transfer-Encoding: binary ");
readfile('./xampp/htdocs/$release');*/
?>