Buon Giorno
Sto cercando di recuperare la risposta di una chimata tramite Curl, si tratta di una conservazione a norma che abbiamo eseguito noi tramite il nostro sistema.

Stampando il curl a video ottengo un codice del tipo


PKfY$22-04-2024_22-05-2024-DIARIO.pdf.p7m cxeQ - c۶ cwl۶; ձm۶m w s~ { 0k U5 Ƙ  $E X #, 8P   =<, n  0 ( 80ۇ  XNH    Z V  VN  믝  ^(Z#{kG;#{< n r o { &bj `d G+b `$dd`m 5 # 9 vFz P.鞱 =|ȁ oa s}p V S `  |f.B э ]c  բ P 3 + rF]0 L w8 5 [Ӹ td Y t=0Vb [: H =Ey \v) 7vgn П
&Q~ (t9  lȫ h^=䄚Ζ < >  n ] :O Y  T [  ǽ h F6 ,"0P h R; v{ uyh S{ ţ : j- \㴐Q{ C1 v ՚K LP[c ç ]wّۓm 3c: Ֆ {
n"8   l ݯh+_ xh  l@L' (Pw Q ] ̤ ȿ |C = = w( i} P F z .xt_ ٙi ؘ i ص r uZ ؀ г7 G+fd d `j G- oaj ]  8 /S V_ aje G jj oeo  w;  W X ?3  % ofd ?f UM @ NG e = tߞ S 3 :R HAT *M  -m d6  h
x_"g t k; _ |ϰ G 1
 $ `yR 0") 5 # =# 6= L Q8fV n# # .x,( ! ~D1& ,:,y M> Tt m C \l f J͹`S%f19 F 迗D ȭPﹱ8 q #,$t A FNND8 lY nY |

ecc ecc ...................


Si tratta di un file zip contenente 4 file di cui due xml 1 come potete vedere pdf firmato digitalmete e il pdf originale.


Il codice di CURL che utilizziamo per la richiesta


$urlcsess = ''.$urlrec.''.$tokenric.'';
curl_setopt($chids,CURLOPT_URL,$urlcsess);
curl_setopt($chids,CURLOPT_HEADER, false);
curl_setopt($chids,CURLOPT_RETURNTRANSFER,true);
curl_setopt($chids,CURLOPT_ENCODING, '');
curl_setopt($chids,CURLOPT_MAXREDIRS, 10);
curl_setopt($chids,CURLOPT_TIMEOUT, 0);
curl_setopt($chids,CURLOPT_FOLLOWLOCATION, true);
curl_setopt($chids,CURLOPT_HTTP_VERSION, 'CURL_HTTP_VERSION_1_1');
curl_setopt($chids,CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($chids,CURLOPT_HTTPHEADER, array(
'ldSessionId:'.$ldsessionId.'',
'Accept: application/x-zip-compressed',
));

$resultids = curl_exec($chids);


Vi chiedo gentilmente di auitarmi a capire il modo per trasformare questo codice che ci viene restituito dal server nella risposta curl in un file .zip scaricabile ?


Grazie