What do you want to save?
Add Code snippet
New code examples
-
PHP 2022-03-17 06:35:44
download file zip from subdirectory using php
<?php // Create ZIP file if(isset($_POST['create'])){ $zip = new ZipArchive(); $filename = "./myzipfile.zip"; if ($zip->open($filename, ZipArchive::CREATE)!==TRUE) { exit("cannot open <$filename>\n"); } $di... Add solution -
PHP 2022-02-09 21:25:15
php download all files in directory
Thanks to the help from @maxhud I was able to come up with the complete solution. Here is the final code snippet used to achieve my desired results: <?php /* creates a compressed zip file */ function create_zip($files = array(),$destination = '',$over... Add solution -
PHP 2022-02-01 07:30:31
php recursive zip with less memory
$source = <absolute pathname to directory/file to be zipped> . DIRECTORY_SEPARATOR; $fileName = "myfiles.zip"; $destination = <absolute pathname to destination directory> . DIRECTORY_SEPARATOR . $fileName; function zip_files( $sourc... Add solution -
PHP 2021-11-03 00:59:11
Download multiple files as zip in PHP
<?php /* create a compressed zip file */ function createZipArchive($files = array(), $destination = '', $overwrite = false) { if(file_exists($destination) && !$overwrite) { return false; } $validFiles = array(); if(is_array($files))... Add solution -
PHP 2021-10-12 14:16:03
how to do backup to website in php code
if (!file_exists('/home/sites/'.$_SERVER['SERVER_NAME'].'/cbitsbackup/')) { mkdir('/home/sites/'.$_SERVER['SERVER_NAME'].'/cbitsbackup/', 0777, true); } $filefront = '/home/sites/'.$_SERVER['SERVER_NAME'].'/cbitsbackup/backup-'.$_SERVER['SERVER_NAME'].'-d... Add solution -
PHP 2021-09-02 20:10:01
php compress csv file
$zip = new ZipArchive(); $filename = "./test1.zip"; if ($zip->open($filename, ZipArchive::CREATE)!==TRUE) { exit("cannot open <$filename>\n"); } $zip->addFile($thisdir . "/file1.csv"); $zip->close(); Add solution