Ver Mensaje Individual
  #1 (permalink)  
Antiguo 19/05/2009, 14:16
Avatar de Superlinux
Superlinux
 
Fecha de Ingreso: octubre-2005
Ubicación: Colombia
Mensajes: 662
Antigüedad: 18 años, 6 meses
Puntos: 1
Pregunta descarga de archivo ..

me funciona bien localmente .. pero en linea en vez de descargar el archivo xls ... descarga el archivo descarga_silumador.php ...



la pagina donde esta el enelace que descarga

Código PHP:
<a href="descarga_silumador.php?idesp=simulador_esp.xls"><img src="../img/descargar.png" border="0"></a>


<
a href="descarga_silumador.php?idcli=simulador_cli.xls"><img src="../img/descargar.png" border="0"></a>

<
a href="descarga_silumador.php?idhot=simulador_hot.xls"><img src="../img/descargar.png" border="0"></a
descarga_silumador.php
Código PHP:
<?php
if($_GET['idesp'] == TRUE){
    
$enlace $path."../ventas/simulador/".$idesp;
    
header ("Content-Disposition: attachment; filename=".$idesp);
    
header ("Content-Type: application/octet-stream");
    
header ("Content-Length: ".filesize($enlace));
    
readfile($enlace);
}
//fIN DEL IF

if($_GET['idcli'] == TRUE){
    
$enlace $path."../ventas/simulador/".$idcli;
    
header ("Content-Disposition: attachment; filename=".$idcli);
    
header ("Content-Type: application/octet-stream");
    
header ("Content-Length: ".filesize($enlace));
    
readfile($enlace);
}
//fIN DEL IF

if($_GET['idhot'] == TRUE){
    
$enlace $path."../ventas/simulador/".$idhot;
    
header ("Content-Disposition: attachment; filename=".$idhot);
    
header ("Content-Type: application/octet-stream");
    
header ("Content-Length: ".filesize($enlace));
    
readfile($enlace);
}
//fIN DEL IF
?>

Gracias por la ayuda ---
__________________
"La vida sigue su curso, tú toma parte de ella."