Ver Mensaje Individual
  #16 (permalink)  
Antiguo 22/03/2009, 09:50
majony
(Desactivado)
 
Fecha de Ingreso: diciembre-2008
Mensajes: 421
Antigüedad: 15 años, 4 meses
Puntos: 0
Respuesta: Paginas Modulares

POR FIN GATOR VALIO LA PENA TANTO ESFUERZO EN ESTE MODULO PERO POR FIN ACABE SATISFACTORIAMENTE GRACIAS ENSERIO POR TODO
LA SOLUCION:
DECIDE NO PONER EN MI CONTROLADOR ESA C0NEXION ENTONCES CREE UN SCRIPT LLAMADO DESCARGAS.PHP
Código PHP:
Ver original
  1. <?php
  2. $ruta = $_GET['ruta'];
  3. $archivo_arr = explode ($_SERVER['DOCUMENT_ROOT'].'/proyecto_cisco/modulos/descargas/vistas/archivos/',$ruta);
  4. //$archivo_arr = explode( "C:/xampp/htdocs/repasos/descargas9/archivos/", $ruta );
  5. $archivo = $archivo_arr[count($archivo_arr) - 1];
  6.  
  7. if( !file_exists( $ruta ) ) {
  8.          die( "No existe $ruta" );
  9. }
  10.  
  11. header( "Content-Disposition: attachment; filename=".$archivo."");
  12. header( "Content-type: application/octet-stream" );
  13. header("Content-Length: ".filesize($ruta)); //header que envia al navegador el tamaño del archivo.
  14. @readfile( $ruta );  
  15. ?>

Y en listar hago una enlace directo
Código php:
Ver original
  1. <a href="modulos/descargas/vistas/descargar.php?ruta=<?php echo 'archivos/'.$item_descarga->ruta; ?>">Descargar</a></div>

Ahora descarga sin problemas ante todo muchas Gracias Gator de verdad se te agradece mucho AMISTAD