1
I’m trying to zip the briefcase img
to play in the folder zipped, but I’m not succeeding.
Would you like to know what the mistake is? Because I’ve seen some tutorials and I can’t zip
$diretorio = getcwd().'/zipado/'; //para onde vou mandar
$zip = new ZipArchive();
if($zip->open('nome_arquivo_zip.zip', ZIPARCHIVE::CREATE) == TRUE){
$zip->addFile($diretorio.'teste.zip', getcwd().'/img/');
}
Is the application returning any error? Or the file is not being saved only?
– Vinicius Farias
The file is not being saved
– teste-90
Try to put after this addFile, the following code: $zip->close();
– Vinicius Farias
Have you seen the parameters that method
addFile
receives? The first is the filename of the file to be added and you are passing the name of the Zip itself.– Woss