include("../include/db.phtml");
$fecha_hoy=date("Y-m-d");
$sql_arch="SELECT A.URL_ARCHIVO,A.TITULO AS TITULO, A.TIPO,A.DURACION,A.SIZE,'0' PALABRA
FROM ARCHIVO_T A WHERE A.ARCHIVO_ID='$archivoid'";
$result=mysql_query($sql_arch);
$my_row_download=mysql_fetch_array($result);
$dir_videos="/var/www/vhosts/vivelasemanasanta.com/httpdocs/";
$var1 = explode("www.vivelasemanasanta.com",$my_row_download[URL_ARCHIVO],strlen($my_row_download[URL_ARCHIVO]));
$archivo="$dir_videos$var1[1]";
$nombre = explode("/",$archivo,strlen($archivo));
//echo $my_row_download[URL_ARCHIVO];
if(is_file($archivo)){
// header("Content-Type: ".mime_content_type($archivo));
header('Content-Description: File Transfer');
header("Content-Type: application/octet-stream");
header("Content-length: ".filesize($archivo));
header("Content-Disposition: attachment; filename=\"$nombre[10]\"");
header("Content-transfer-encoding: binary");
$fp=fopen($archivo, "rb");
// fpassthru($fp);
$filedata=fread($fp,filesize($archivo));
fclose($fp);
echo $filedata;
}
?>