/ Published in: PHP
Code for downloading multiple files as Zip file
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php $filesToSend = $_POST['files']; $zip = new ZipArchive(); $res = $zip->open($zipname, ZipArchive::CREATE); if ($res === TRUE) { foreach ($filesToSend as $file) { } } else { echo 'failed, code:' . $res; } $zip->close(); } else { echo "nothing new"; } } ?>