Re: Re: Tar Files and send back to browser
| From: | Erwin | Date: | Thu, 26 Sep 2002 12:52:52 +0000 |
| Subject: | Re: Re: Tar Files and send back to browser | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-117710@lists.php.net to get a copy of this message | ||
> Now I tried to use your script:
>
> $_REQUEST['image'] is =
> '../images/2002/09/jpg/ls006022_pettersson_johan.jpg';
>
> <?
> Header('Content-Type: application/x-gzip');
> $command = 'tar -cf - ../images/' . $_REQUEST['image'] . ' | gzip -
> cf'; system( $command );
> ?>
>
> It opens the download dialog again and lets me download the archive,
> but it's named
> download.gz (How can I change it to ls006022_pettersson_johan.gz?)
Add another header (another one???) ;-))
Header( 'Content-Disposition: attachment;
filename=ls006022_pettersson_johan.gz' );
> And if I open it with winrar it says, the content is named 'download'
> Size is about
> 1600000 bytes, seems to be correct. when I try to extract the files
> there pops up
> an error message which says: Unexpected end of archive.
>
> Have you got a sollution on that?
Yes...my mistake, use passthru( $command ) instead of system( $command )
Grtz Erwin