I'd like to list the root content of the zip archive to detect if there's only one directory there so that I could extract just the content of this directory without itself - just in case someone uploads a file made by simple "add to archive".
For instance if I get a file containing:
directory
|- fileA
|- fileB
I want to extract just fileA
and fileB
but if I receive a file with multiple dirs/files in the main node I want to keep the structure. Is there an easy way to do so? Please, keep in mind I need just the root directory and simple iteration gives the list of all files.