multiple file download for client?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
allasso
Forum Commoner
Posts: 28
Joined: Fri Nov 28, 2008 1:24 pm

multiple file download for client?

Post by allasso »

Hello,

I have done much searching and experimenting for the answer to this, but to no avail. I thought I would turn to the forums.

I would like for to be able to allow a client have the option to download multiple files as attachments with one request, eg, the client clicks a link on a page, or submit button, and several file download dialog boxes appear.

I have tried,

<?php

$type_ = EZ_ ;

header('Content-type: text/html');
header("Content-Disposition: attachment; filename=file_$type_.html");
readfile("file_$type_.html");

$type_ = prod_ ;

header('Content-type: text/html');
header("Content-Disposition: attachment; filename=file_$type_.html");
readfile("file_$type_.html");

?>

but it only does the first request.

I have tried many other things as well. Any ideas?

Thank you, Allasso
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: multiple file download for client?

Post by jaoudestudios »

I dont think it is possible. This is a security feature by the browsers.

Zip everything together then get the user to download the zip file that contains the multiple files.
Post Reply