Php save zip to disk

I want the zip files to be downloaded by the user to a specific location. Although the download part works, I have no idea how to fix the file. I can create a zip, but not now, how to actually save it to disk.

+8
file php upload web zip
source share
2 answers

Just skip the desired destination path to zip when creating it:

$path = 'path/to/file.zip'; $zip = new ZipArchive(); $zip->open($path, ZipArchive::CREATE); // add contents... $zip->close(); 
+11
source share

This will certainly help you ... These are 2 well-explained examples, hope this helps.

+2
source share

All Articles