Sascha Braun wrote:
Hi,
I want to make some people download files the server tar's on demand.
But i don't know really how to send the files back to the browser.
I used the following command for taring the file:
?
$command = 'tar -c '.$arrResult['name'].'.tgz
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
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
Seems to work not that bad, but I got another Question.
Why isn't there anything in the archive?
This is my code yet:
?
Header('Content-Type: application/x-tar');
Header(Content-disposition: attachment;
filename=.$_REQUEST['name']..tar);
$command = 'tar -cf - ../images/' . $_REQUEST['image'];
Sascha Braun wrote:
Seems to work not that bad, but I got another Question.
Why isn't there anything in the archive?
It works in here (just tested it), I don't know why it's empty (don't stop
reading here!!! :-) )
This is my code yet:
?
Header('Content-Type: application/x-tar');
Ok, somebody told me, the archive contains the Image, only winrar seems not
to show the image, grrr.
I tried the gzip method and it did not work that fine for me.
Sascha Braun wrote:
Seems to work not that bad, but I got another Question.
Why isn't there anything in the archive?
It
Sascha Braun wrote:
Ok, somebody told me, the archive contains the Image, only winrar
seems not to show the image, grrr.
;-))
That's why...i did see the image too!
I tried the gzip method and it did not work that fine for me.
Hmz...too bad, because you will get smaller downloads then (use
Do you know how to exclude the path informations in the tar archive?
Sascha Braun wrote:
Ok, somebody told me, the archive contains the Image, only winrar
seems not to show the image, grrr.
;-))
That's why...i did see the image too!
I tried the gzip method and it did not work that
Sascha Braun wrote:
Do you know how to exclude the path informations in the tar archive?
Yes, first chdir to the ../images directory
http://www.php.net/getcwd
http://www.php.net/chdir
Grtz Erwin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
IT'S WORKING, GOOD DAMN, IT'S WORKING!
Yo, this was a really hard Job, if I look at the working snipped below!
?
Header('Content-Type: application/x-tar');
Header(Content-disposition: filename=.$_REQUEST['name']..tar);
$dir = explode(/, $_REQUEST['image']);
10 matches
Mail list logo