RE: [PHP-ES] Forzar Descarga de archivo
| From: | Cesar .... | Date: | Wed, 16 Jul 2008 20:07:46 +0000 |
| Subject: | RE: [PHP-ES] Forzar Descarga de archivo | ||
| References: | 1 2 3 4 | Groups: | php.general.es |
| Request: | Send a blank email to general-es+get-62914@lists.php.net to get a copy of this message | ||
Proba con este codigo ya que el read file es solo el directorio en donde se encuentra tu imagen
que es leida por el
filename.
Me cuentas como te fue.
$file = 'foto.jpg'
$ruta = '"/directorio/de/foto';
header ( 'Content-Type: application/octet-stream'); header("Content-Length:
" . filesize($ruta)); header( "Content-Disposition: attachment; filename=".$file);
readfile($ruta );
cesar...> From: jbuda@noticiasargentinas.com> To: php-es@lists.php.net> Date: Wed, 16 Jul
2008 14:38:20 -0300> Subject: [PHP-ES] Forzar Descarga de archivo> > Hay algun error en
este codigo para forzar la descarga de un archivo dado?> > <?> $foto =
"foto.jpg";> > $path = "/directorio/de/foto/";> >
header("Content-type: application/octet-stream");> >
header("Content-Disposition: attachment; filename=\"$foto\"\n");> >
@readfile($path.$foto); > > ?>> > > La imagen existe , me tira a descargar pero
baja vacia.> Uso php 4.3.10-22 sobre Apache/1.3.33 en un Debian Sarge.> > Gracias por
cualquier ayuda> > Jose Julian Buda> > > > > -- > PHP Spanish Localization
Talk Mailing List (http://www.php.net/)> To unsubscribe, visit: http://www.php.net/unsub.php>
_________________________________________________________________
Time for vacation? WIN what you need- enter now!
http://www.gowindowslive.com/summergiveaway/?ocid=tag_jlyhm