MOON
Server: Apache/2.2.34 (Unix) mod_ssl/2.2.34 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4 FrontPage/5.0.2.2635
System: Linux server.asjudinet.com 2.6.32-042stab141.3 #1 SMP Fri Nov 15 22:45:34 MSK 2019 i686
User: asjudine (504)
PHP: 5.2.17
Disabled: NONE
Upload Files
File: /home/asjudine/www/avigilajudicial/descargar_archivos_vigi_judicial_actuacion.php
<?php
header("Content-type:application/pdf");

require_once("../Conectarse_.php");
global $dbi;



$result = mysql_query('SELECT id, nombre, contenido, tipo, ruta_archivo FROM actuaciones_vigilancia_judicial WHERE id= "'.$_GET["id"].'"  ');
if (!$result) {
	die('Invalid query: ' . mysql_error());
}


if ((mysql_num_rows($result)!=0)) 
{
	
	while(list($id, $nombre, $contenido, $tipo, $ruta_archivo)=mysql_fetch_row($result)){
		$id = $id;
		$nombre = $nombre;
		$contenido = $contenido;
		$tipo = $tipo;
		$ruta_archivo = $ruta_archivo;
		
		
		// AquĆ­, establecemos la cabecera del documento 
		//header("Content-Description: Descargar imagen"); 
		//header("Content-Disposition: attachment; filename=$nombre");
		//header("Content-Type: application/force-download"); 
		//header("Content-Length: " . filesize($nombre)); 
		//header("Content-Transfer-Encoding: binary"); 
		
		//header("Content-type: $tipo");
		//header("Content-Disposition: attachment; filename=$nombre");
		//print $contenido;
		//readfile ($ruta_archivo);
		
		//FUNCIONABA
		/*
		header('Content-Type: application/force-download');
	   	header('Content-Disposition: attachment; filename='.$nombre);
	   	header('Content-Transfer-Encoding: binary');
	   	header('Content-Length: '.filesize($ruta_archivo));

	   	readfile($ruta_archivo);
		*/
		/////////
		
		header("Content-type: application/force-download");
		$archivo=$ruta_archivo;
		header("Content-Length: " . filesize ($archivo) ); 
		header("Content-type: application/pdf"); 
		header("Content-disposition: inline;     
		filename=".basename($archivo));
		header('Expires: 0');
		header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
		$filepath = readfile($archivo);
		
		
	}
}  




?>