尝试使用CURL
查询形成为:
$postdata = array(
'FileToLoad' => "@".$this->file."; filename=\"$this->filename\";",
'fileId' => $this->fileId);
$this->file
包含服务器/var/www/site/data/www/site.ru/tmp/file.pdf
发送:
if( $curl = curl_init() ) {
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata);
curl_setopt($curl,CURLOPT_ENCODING, '');
curl_setopt($curl, CURLOPT_COOKIE, ".ASPXAUTH=$this->token;");
$out = curl_exec($curl);
curl_close($curl);
}
请求成功,但数据位于$_POST
,我真的想在$_FILES
中看到。我哪里错了?