Hi,
I am dead in the water with this. I cannot discover the problem.
I am trying to upload a file with curl and also pass a text value. It refuses to work.

Here 's a test form:
http://85.17.135.223/test.php<?php
if (!empty($_REQUEST)) {
var_dump ($_REQUEST);
}
?>
<html>
<body>
<form>
<input type="text" name="a" value="value1" />
<input type="file" name="file1" />
<input type="submit" />
</form>
</body>
And then there 's the php script.
$url = 'http://85.17.135.223/test.php';
$file = getcwd().'/'.'step3.php';
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, array('type' => 'direct', 'file1'=>"@$file", 'a'=>'aaaaa1'));
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLINFO_HEADER_OUT, true);
$result = curl_exec ($ch);
echo curl_error($ch);
$info = curl_getinfo($ch);
var_dump($info);
Here are the headers:
POST /test.php HTTP/1.1 Host: 85.17.135.223 Accept: */* Content-Length: 10448 Expect: 100-continue Content-Type: multipart/form-data; boundary=----------------------------b64cdfea8248
It does not work like it does if you do in through the browser. No script output! How can I make this work?
Thank you!