Nasıl zip dosyasını okumak ve dosya veya klasörlerin bilgi PHP ayıklayacak olmadan içeren alabilirim?

0 Cevap php

Ne ben aslında yapmak istedim zip dosyasını okuyun ve sonra klasör içermiyor sonra bazı mesajı ile bunu reddetmektir.

I want user should upload zip file with files only without any directory structure. So I want to read zip file contains and check file structure. I am trying with 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.  
}

0 Cevap