Uname: Linux info 3.0 #1337 SMP Tue Jan 01 00:00:00 CEST 2000 all GNU/Linux
Software: Apache
PHP version: 5.6.40 [ PHP INFO ] PHP os: Linux
Server Ip: 217.160.0.194
Your Ip: 216.73.216.203
User: u72294154 (9179942) | Group: ftpusers (600)
Safe Mode: OFF
Disable Function:
NONE

name : ver.php
<?
require_once 'global.lib.php';
require_once '../documentacion/config.php';
aut_verifica();

if(isset($_GET['archivo']) && $_GET['archivo'] != ''){

	$archivo = strip_tags($_GET['archivo']);
	
	if(strpos($archivo,"../")!==false)
		die;
		
	// if(function_exists('mysql_real_escape_string')){
		// $archivo = mysql_real_escape_string(archivo);
	// }
	// else{
		// $archivo = addslashes(archivo);
	// }

	// echo $archivo;
	
	$temp = explode('/',$archivo);
	
	
	// print_r($temp);
	
	if(count($temp) == 2){
		$archivo = $temp[1];
	    $directorio = $temp[0];
	
		$SQL = "SELECT id,nombre FROM $directorio WHERE archivo = '$archivo'";
		$c = @mysql_query($SQL);
		
		if(mysql_num_rows($c) == 1){
			$r = mysql_fetch_assoc($c);
					
			$root = $_SERVER['DOCUMENT_ROOT']."/webadmin/filesdb/";

			$path = $root.$directorio.'/'.$archivo;
			$type = '';
			$info = pathinfo($path);
		
			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";
				}
				// Establecer Headers
				header("Content-Type: $type");
				header("Content-Disposition: attachment; filename={$r['nombre']}.{$info['extension']}");
				header("Content-Transfer-Encoding: binary");
				header("Content-Length: " . $size);
				
				//Descargar archivo
				
				readfile($path);
			
			} 
			else {
				die("File not exist !!");
			}

		}
		else
			die;
	}
	else
		die;
	
}
else
	die;
?>
© 2026 GrazzMean