1
$request = Request::factory($url)->method(Request::POST)->post('xml', '@' . $filepath);
echo $request->execute();
但的print_r($ _ FILES);在目標腳本中返回空數組。 Kohana中的
版本是3.2.0穩定
我要的是一個簡單的模擬
$ch = curl_init();
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0");
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_COOKIESESSION, TRUE);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, array('xml' => '@' . $filepath));
$res = curl_exec($ch);
echo $res;
它不是Kohana) – Argnist 2011-12-18 07:17:41