Friday, 30 August 2013

PHP - output a multi-part content to browser for download

PHP - output a multi-part content to browser for download

I want to send a multi-part content to browser (actually, a bunch of
images to be downloaded in a single file).
For example, when I want to send a single file, I would use:
$size = getimagesize($file);
header('Content-Type:'.$size['mime']);
readfile($file);
and the result will be an image. But how can I send multiple files in a
single response? I have already seen that in a website (a file will be
output and you can download it, and it includes all images).

No comments:

Post a Comment