Created
January 9, 2018 16:43
-
-
Save leepettijohn/80c7096fc130bf2d9ce6ea2020579546 to your computer and use it in GitHub Desktop.
Create a zip folder from media
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
function create_zip_file(){ | |
$zip = new ZipArchive(); | |
$filename = "test114.zip"; | |
if ($zip->open($filename, ZipArchive::CREATE)!==TRUE) { | |
exit("cannot open <$filename>\n"); | |
} | |
$zip->addFile($_SERVER['DOCUMENT_ROOT']."/wp-content/uploads/2018/01/Bus-Card-ABC-Domestic-Live-Kelly-Ryan.jpg"); | |
$zip->close(); | |
} | |
add_action ('genesis_after_header','create_zip_file'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment