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/acalidad/descargar_archivos.php
<?php

require_once("../Conectarse.php");

$fecha_actual=date("Y/m/d");
$time=strftime( "%H-%M-%S", time() );


			$result = mysql_query('SELECT * FROM archivos WHERE id = "' . $_GET["Id"]  . '"');
			if (!$result) {
				die('Invalid query: ' . mysql_error());
			}



if ((mysql_num_rows($result)!=0)) 
{



			$row = mysql_fetch_row($result);
			$id = $row[0];
			$nombre = $row[1];
			$contenido = $row[4];
			$tipo = $row[5];


$csqle1 = mysql_query("INSERT INTO notificaciones_correspondencia (cedula,fecha,hora_descargue,radicado,id_archivo,actuaciones_de_envio) VALUES ('".$row[6]."','".$fecha_actual."','".$time."','".$row[7]."','".$_GET["Id"]."','ESTA ES LA FECHA Y HORA EN QUE EL AFILIADO SE NOTIFICO')");

header("Content-type: $tipo");
header("Content-Disposition: attachment; filename=$nombre");
print $contenido; 


}



else 

{
	
				$result = mysql_query('SELECT * FROM archivos_nuevos WHERE id = "' . $_GET["Id"]  . '"');
			if (!$result) {
				die('Invalid query: ' . mysql_error());
			}

			$row = mysql_fetch_row($result);
			$id = $row[0];
			$nombre = $row[1];
			$contenido = $row[4];
			$tipo = $row[5];


header("Content-type: $tipo");
header("Content-Disposition: attachment; filename=$nombre");
print $contenido; 


}
	


?>