M
M
Max Payne2015-04-01 16:48:35
PHP
Max Payne, 2015-04-01 16:48:35

Why does the Invalid or unitialized Zip object error occur?

After downloading the file, I try to archive it using the ZipArchive class and get an error:

Warning: ZipArchive::addFile(): Invalid or unitialized Zip object in ... on line 48
Warning: ZipArchive::close(): Invalid or unitialized Zip object in ... on line 49

48 and 49 lines of code I attach:
$zip->addFile($_FILES['file']['tmp_name'][$i], $fileName1.'.'.get_ext($_FILES['file']['name'][$i]));
$zip->close();

All variables exist (checked :) ).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Leonid Sysoletin, 2015-04-01
@YardalGedal

It is said - $zipeither beaten, or not initialized.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question