Is Multiple download files possible using PHP?
We did find a code for single download. but we need it for multiple download.
can anybody help me? Thank you! :)

:O Why don't you use a ZIP folder? I don't think you can run multiple downloads.

i was also having such requirement once.
Then what i have done is:
create zip file of multiple files using php and then download that zip file.
Thus user can have multiple files in one zip.

we are using checkboxes for the multiple download.
How do we zip the files?

Here i have attached complete code.
This code will get two image file and zip ait and download it.
run test.php file in browser and you will have one zip file.

Here i have attached complete code.
This code will get two image file and zip ait and download it.
run test.php file in browser and you will have one zip file.

thank you for your help.

i'm having a difficulty disecting your code since i'm using a checkbox that will determine what particular .pdf file will be added to the zip file. do you still have another example for it?? :)

again,, you helped me a lot...

I can't open the zip file O_o

sorry for interruption... i can download now the files... but those files are in a root folder... how can i change the $data so that it will get the file from a folder? :)

If you are referring my attached test.php.
then you will find below code at line # 125

// Test this class
$zipTest = new zipfile();
$zipTest->add_dir("images/");
$zipTest->add_file("photo.png", "images/photo.png");
$zipTest->add_file("logooo.jpg", "images/logooo.jpg");

Thus in add_file function you can pass whatever is your file location.

Here i have attached complete code.
This code will get two image file and zip ait and download it.
run test.php file in browser and you will have one zip file.

thanks.. my program is now running.. because of YOU!!! THUMBS UP!!

:)

I would like to know how you implemented the checkbox to pass values to only add the files that the user checks the box next to.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.