파일을 다운로드하고 저장하고 싶습니다. gzip 파일을 다운로드 할 때이 코드를 사용하고 있습니다.php를 통해 gzip 파일을 다운로드하십시오. cURL
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $this->_params['url']);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible;)");
curl_setopt($ch, CURLOPT_POST, true);
$post = array("image_id"=> $this->_response_id, "format"=>$this->_response_format);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
$response = curl_exec($ch);
curl_close($ch);
그러나 결과 유형을 인쇄 할 때 문자열이 표시됩니다 (문자열 형식의 파일이 표시됨).
어떻게이 문제를 해결할 수 있습니까?
감사합니다.
한 쪽지는 내 질문과 연결되어 있습니다. 인쇄 할 때 ($ info = curl_getinfo ($ ch, CURLINFO_CONTENT_TYPE);) image/svg + xml을 볼 수 있습니다. @ goreSplatter, 내가 당신을 위해 잊어 버렸습니다. 당신의 코멘트 (나는 당신이 그것을 사랑한다는 것을 안다 :) :) –