Ver Mensaje Individual
  #6 (permalink)  
Antiguo 03/01/2004, 13:06
marylin77
 
Fecha de Ingreso: septiembre-2003
Mensajes: 48
Antigüedad: 20 años, 7 meses
Puntos: 0
A mí se me descargan las cosas con 0 bytes, es decir, vacías...por qué puede ser?
El código es este:
Código PHP:
PHP:

function 
descargas(){ 
$practica=$_REQUEST[fichero];//$practica=mytable.txt 
//echo "$practica"; 

$fichero="/NUKE67/$_SESSION[carrera]/$_SESSION[nombrea]/$_SESSION[nombre]"." "."$_SESSION[apellidos]/$practica"
//echo "$fichero"; 
//$fichero=/NUKE67/Ingeniería Automática/Control II/María Sánchez/mytable.txt 
//the path exists 
$nombre_fichero=basename($fichero); 
//$nombre_fichero=mytable.txt 
//echo "<br>$nombre_fichero"; 
if ((strstr($_SERVER['HTTP_USER_AGENT'], 'compatible; MSIE ') !== false )&& (strstr($_SERVER['HTTP_USER_AGENT'], 'Opera') === false)) 

      
// IE doesn't properly download attachments.  This should work 
      // pretty well for IE 5.5 SP 1 

      
header("Content-Disposition: inline; filename=\"$nombre_fichero\""); 
      
header("Content-Type: application/octetstream; name=\"$nombre_fichero\""); 
      
header("Content-length:".(string)(filesize("$fichero"))); 
   } else { 
      
// Use standard headers for Netscape, Opera, etc. 
      
header("Content-Disposition: attachment; filename=\"$nombre_fichero\""); 
      
header("Content-Type: application/octetstream; name=\"$nombre_fichero\""); 
      
header("Content-length: ".(string)(filesize("$fichero"))); 

   } 

  
readfile("$fichero"); 



return;