How can I reduce the size of a ZIP
file created with PHP
. I'm able to zip it but its size remains the same as I can decrease the size of it.
for example I want to zip a 2MB
file and when I zip I want ZIP
to be less than 1MB
or even 1MB
how to do that?
My code
$zip = new ZipArchive();
if( $zip->open( 'teste/sample.zip' , ZipArchive::CREATE ) === true) {
$zip->addFile( 'teste/arqtest.pdf' , 'arqtest.pdf' );
$zip->close();
}