What I really wanted to do was read the zip file, and then if it contains a folder, cancel it with some message.
I want the user to upload a zip file with files only without any directory structure. So I want to read the zip file and check the file structure. I am trying to make the following code snippet.
$zip = zip_open('/path/to/zipfile');
while($zip_entry = zip_read($zip)){
$filename = zip_entry_name($zip_entry);
//@todo check whether file or folder.
}
Kammy source
share