Ver Mensaje Individual
  #1 (permalink)  
Antiguo 20/11/2009, 15:34
vashzero
 
Fecha de Ingreso: marzo-2007
Mensajes: 25
Antigüedad: 17 años, 2 meses
Puntos: 0
Descargar archivos en php

Mi pregunta es tal cual.

Cómo descargo un archivo en PHP?

Ya que tengo este código:

Cita:
$file = file(getcwd()."/proyecto/".$_POST["archivo"]);
$file2 = implode("", $file);
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=$file");
header("Content-Length: ".strlen($file2)."\n\n");
echo $file2;
El problema es que me salen un poco de garabatos y dice algo como:

Warning: Cannot modify headers information - headers already sent by (output started by /../../../../descargar.php in /../../../../descargar2.php on line 65.

Si alguien me pudiera ayudar, estaría MUY AGRADECIDO!!

Saludos..