zipfile - drupal 7 Cannot open in ArchiverZip->__construct -


i'm using code extract zip file

$file = "/sites/default/files/xml_files/file.zip"; $obj = new archiverzip($file); 

but error thrown:

exception: cannot open <em class="placeholder">/sites/default/files/xml_files/file.zip</em> in archiverzip->__construct() 

i use too:

$file = drupal_realpath(file_default_scheme() . '://')."/xml_files/file.zip"; $obj = new archiverzip($file); 

but thrown same exception.

any idea ? thank you

try use following:

$archive_file = 'public://xml_files/file.zip' $directory = 'temporary:///extracted_files'     $archiver = archiver_get_archiver($archive_file); $archiver->extract($directory); 

Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -