<?php
ob_start();
ob_clean();
session_start();
if (!isset($_POST['slbvideos']) || empty($_POST['slbvideos'])) {
exit();
}
$root = "../../comunes/documentos/";
$file = trim($_POST['slbvideos']);
$path = $root.$file;
$type = '';
if (is_file($path)) {
$size = filesize($path);
if (function_exists('mime_content_type')) {
$type = mime_content_type($path);
} else if (function_exists('finfo_file')) {
$info = finfo_open(FILEINFO_MIME);
$type = finfo_file($info, $path);
finfo_close($info);
}
if ($type == '') {
// $type = "application/force-download";
$type = "application/octet-stream";
}
// Definir headers
header("Content-Type: $type");
header("Content-disposition: attachment; filename=$file");
header("Content-Transfer-Encoding: binary");
header("Content-Length: " . $size);
// Descargar archivo
readfile($path);
} else {
die("El archivo no existe.");
}
?>
el problema al final es que me descarga un archivo pero cuando lo voy a reproducir en windows me da error y en linux me dice "No se pudo determinar el tipo de flujo"..
![lloron](http://static.forosdelweb.com/fdwtheme/images/smilies/chillando.png)
upload_max_filesize = 50M