For example, note: images are not collected and are already on the server. You need to select a few images and download them to your computer, I don't know how to solve the problem,
Note: images are not collected. images are already on the server. You need to select a few images and download them to your computer. There is no problem for each image.
Reply content:
For example,
Note: images are not collected. images are already on the server. You need to select a few images and download them to your computer. There is no problem for each image.
$ Zip = new \ ZipArchive; // compressed file name $ filename = 'download.zip '; // create a zip package $ zip-> open ($ filename, \ ZipArchive: OVERWRITE ); // Add one image to the compressed foreach ($ images as $ key = >$ value) {$ zip-> addFile ($ value );} // zip $ zip-> close (); // you can directly redirect the download header ('location :'. $ filename); // or the output download header ("Cache-Control: public"); header ("Content-Description: File Transfer"); header ('content-disposition: attachment; filename = '. basename ($ filename); // file name header ("Content-Type: application/force-download"); header ("Content-Transfer-Encoding: binary "); header ('content-Length :'. filesize ($ filename); // tell the browser the file size readfile ($ filename );