Php - download zip file from curls and unzip it?

Hi, is it possible to download a zip file using curl and unzip it on the fly without saving the file from disk?

For instance:

.
.
.

$resultZip = curl_exec($curl);

$result = some_unzip_way($resultZip);

Thank! Nik

+3
source share
3 answers

There is a flag in php curl to unzip content, if necessary

curl_setopt($ch,CURLOPT_ENCODING, '')

see this answer

0
source

Its not very simple, php has zip functions, but requires a file. Take a look at the first comment on this page, the guy describes your exact script and gives the code:

http://php.net/manual/en/ref.zip.php

-3
source

Perl may be the best choice for this kind of operation.

-3
source

Source: https://habr.com/ru/post/1781494/


All Articles