Ver Mensaje Individual
  #7 (permalink)  
Antiguo 17/06/2004, 00:27
kez0
 
Fecha de Ingreso: enero-2004
Mensajes: 431
Antigüedad: 20 años, 3 meses
Puntos: 6
este es un force download ke me enkontre por ahi, no lo he probado

Código:
<?
/* Para usar es archivo.php?filename=archivo.extension */
$shortname = basename( $filename );
if( file_exists( $filename )        
    && !eregi( "p?html?", $filename ) 
    && !eregi( "inc", $filename )
    && !eregi( "php3?", $filename ) ){
  $size = filesize( $filename ); 
  header("Content-Type: application/save"); 
  header("Content-Disposition: attachment; filename=".$shortname); 
  $fh = readfile($filename);
	fpassthru($fh);
	 
  exit; 
} else {
?> 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD 4.01 Transitional//EN"
   "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Download Error</title>
 <style type="text/css">
   <!--
   body {background-image:url(include/background.gif);
         font-family:helvetica,arial,sans-serif}
   a:hover {text-decoration:none; border-width:thin; border-style:dotted;
            background-color:#f2f2ff; color:#000000}
   a:focus {text-decoration:none; background-color:#dadae6; color:#000000}
   a:active {text-decoration:none; background-color:#ffffff; color:#000000}
   -->
 </style>
</head>
<body>
<h1>File <?php print( $basename ) ?> not available</h1>
<p>
  Either the file you requested does not exist or you are not permitted to
  download it using this page.
</p>
</body>
</html>
<?php
}
?>


</body>
</html>
__________________
El que teme preguntar, se averguenza de aprender.