D
D
Dim2016-09-30 15:34:08
PHP
Dim, 2016-09-30 15:34:08

How to unzip an archive into a folder with the name of the archive using PclZip?

We upload the %archivename%.zip archive to the Wordpress CMS, it is necessary that they create the %archivename% folder when unpacking and unpack the contents of the archive into it. I could not find something in the PclZip documentation on how to implement this.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim, 2016-09-30
@pudovMaxim

Something like this?

$archive = new PclZip($archivename . '.zip');
$result = $archive->extract(PCLZIP_OPT_PATH, '/path/to/save/' . $archivename);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question