I have lots of files in a particular Directory. In a certain PHP page I lists the contents of the particular directory with links to download each item separately. Now I need to display a Link which will ZIP all the contents of that directory so any visitor can download all the contents as a Single ZIP file.
Share
Use ZipArchive for zipping files and RecursiveDirectoryIterator for getting all files in a directory
something like
Then send the zip to the browser
Obviously you could post the directory name and event the zip file name to the script but it gives you a starting point