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