0

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! :)

Edited by charvie: n/a

5
Contributors
13
Replies
14
Views
6 Years
Discussion Span
Last Post by FloridaCI
Featured Replies
  • 1

    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. Read More

  • [QUOTE=charvie;1316218]we are using checkboxes for the multiple download. How do we zip the files?[/QUOTE] Hmm.. You should read this, pay attention to Example #1. [url]http://php.net/manual/en/function.ziparchive-addfile.php[/url] Read More

  • 1

    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. Read More

0

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

1

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.

0

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

1

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.

0

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...

0

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? :)

0

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.

0

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!!

:)

0

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.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.