1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| $curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "URL",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
rtrim($token, "\r\n")
),
));
$response = curl_exec($curl);
$fichierZipPhotos=json_decode(curl_exec($curl), true);
$name=$numeroAffaire.'_'.$origine.'_'.$numeroNC.'_'.$titre;
header('Cache-Control: public');
header('Content-type: application/zip');
header('Content-Disposition: attachment; filename='.$name.'.zip');
curl_close($curl);
echo $response; |