Create and download Zip folder in php ini_set("memory_limit","1280000M"); ini_set('max_execution_time', 60000); // Zip destination path $zipDestination = __DIR__.'/images/zipfile.zip'; // Use php zip library $zip = new ZipArchive(); touch($zipDestination); // create zip files if($zip->open($zipDestination, ZipArchive::CREATE)!==TRUE) { exit("cannot open <$zipDestination>\n"); } // If you want to add all files from folder $pattern = __DIR__.'/bagImages'; // It will read all files of bagImages folder $files = glob($pattern.'/*.*'); foreach($files as $file) { $fileinfo = pathinfo($file); $zip->addFile($file,$img_fol.'/'.$fileinfo['basename']); } // if you want add sub folder files also use. $rootPath = realpath('images'); $files = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($rootPath), RecursiveIteratorIterator::LEAVES_ONLY ); fo...
Coding Cheatsheets - Learn web development code and tutorials for Software developers which will helps you in project. Get help on JavaScript, PHP, XML, and more.