0
curl을 사용하여 zend 응용 프로그램에 파일을 보내는 예제가있는 사람이 있습니까? 서버 시나리오에 파일을 보내는 클라이언트를 시뮬레이트하려고합니다. 그래서이 두 가지 방법을 시도했지만 게시물 데이터가 없습니다. 이curl 또는 Zend_Http_Client() 파일을 보내려면 어떻게합니까?
$url = 'http://test.com/test';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
$post = array(
'file' => '@file.jpg'
);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
$response = curl_exec($ch);
curl_close($ch);
var_dump($response);
나는 또한 내가 파일을 수신하는 수신기 끝에 어떻게해야하고 무엇 Zend_Http_Client
$client = new Zend_Http_Client($url);
$client->setFileUpload('file.jpg', 'image');
$response = $client->request();
var_dump($results);
와 함께이 시도 $ 포스트 데이터와 컬 방법은? $this->_request->getParams()
을 출력 할 때 아무것도 얻지 못합니다. 이게 뭐야?
이런 종류의 물건을 찾으십니까? http://stackoverflow.com/questions/665334/file-upload-using-zend-framework-1-7-4? – akond