Re: Forzar Descarga de archivo
| From: | Gabriel Sosa | Date: | Sun, 20 Jul 2008 18:13:45 +0000 |
| Subject: | Re: Forzar Descarga de archivo | ||
| References: | 1 2 3 4 5 | Groups: | php.general.es |
| Request: | Send a blank email to general-es+get-62921@lists.php.net to get a copy of this message | ||
Jose,
cambia
readfile por
fpassthru
fijate el ejemplo de [1], yo creo que estas haciendo las cosas bien
saludos
[1] http://ar2.php.net/manual/en/function.fpassthru.php
2008/7/16 Cesar .... <vcesar64@hotmail.com>:
>
> 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
--
Los sabios buscan la sabiduría; los necios creen haberla encontrado.
Gabriel Sosa