i would like to extract the gz file downloaded with api with my script curl.
here is my script :
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://x/x/x.sql.gz',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => 'accept-encoding : gzip, deflate, br',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Authorization: Basic x'
),
));
$response = curl_exec($curl);
$destination = "dump.sql";
$file = fopen($destination, "w+");
fputs($file, $response);
fclose($file);
curl_close($curl);
at the moment all that i get is the gz file, i tried manythings, and now i am stacked.
Thank you for your help