Ver Mensaje Individual
  #8 (permalink)  
Antiguo 14/08/2007, 14:40
Avatar de GatorV
GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años
Puntos: 2135
Re: Problema al descargar archivos con script php

Deberias de hacerlo asi:
Código PHP:
<?php
$f
=$_GET["f"];
$carpeta=$_GET["carpeta"];

$enlace=$carpeta."/".$f;

if( !
file_exists$enlace ) ) {
      echo 
'$enlace no es un archivo o no existe: ' $enlace;
      exit();
}

header("Content-Disposition: attachment; filename=".$f);
header("Content-Type: application/octet-stream");

$fp=fopen($enlace,"r"); 
fpassthru($fp);
?>