1
linuxを使用すると、このスクリプトが動作します。しかし、私はWindowsを使用してスクリプトが動作しない場合。スクリプト:ログにファイルをリモートサーバ(Windows、cURL)にアップロードするときにエラーが発生する
$url="http://site.com/upload.php";
$post=array('image'=>'@'.getcwd().'\\images\\image.jpg');
$this->ch=curl_init();
curl_setopt($this->ch, CURLOPT_URL, $url);
curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($this->ch, CURLOPT_TIMEOUT, 30);
curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($this->ch, CURLOPT_POST, 1);
curl_setopt($this->ch, CURLOPT_POSTFIELDS, $post);
$body = curl_exec($this->ch);
echo $body;
がエラー:
*は
ファイルが存在し、読み取り可能formpostデータを作成できませんでした。あなたが行うときにプリントアウトされた何
ない答え(もそうな溶液)、しかしとしてはさておき、私は[DIRECTORY_SEPARATOR](http://php.net/manual/en/dir.constants使用します。 php)を参照してください)。 (または、少なくともスラッシュ( '/')を使用してスティックしてください。ウィンドウは無関係ですが、* nixの心) –