1
how can I reduce the size of a file ZIP raised with PHP. I’m getting it zipped, but the size of it remains the same as I can get it down.
for example I want to zip a file 2MB and when to zip I want the ZIP be less than 1MB or even a 1MB how to do this?
my code
$zip = new ZipArchive();
if( $zip->open( 'teste/sample.zip' , ZipArchive::CREATE ) === true) {
$zip->addFile( 'teste/arqtest.pdf' , 'arqtest.pdf' );
$zip->close();
}
mp3, jpg files and others already optimize the way they store information and therefore there is not much to do.
– Reginaldo Rigo
If it were possible to zip and have a high compression rate independent of the file then we could zip a file several times and start from a file with several gigabytes and end with a 1MB file.
– Reginaldo Rigo