Hello,
I've been banging my head on this for the past day. I have looked in the php docs and found the example below which I copied. I tried on 2 different servers and I get the error:
"failed creating formpost data".
So it seems to be erroring before the information is even sent via curl.
I have the file "dog.txt" in the same directory as my php script initiating the send. There seems to be something that I am just missing and can't figure it out.
Any advice would be appreciated. I have tried on my local machine using Apache and on my remote server using Windows IIS with the same error.
[pre]<?php
$postData = array();
$postData['uploaded'] = "@dog.txt";
$postData['submit'] = "UPLOAD";
$postData['max_file_size'] = "300000";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://www.mydomain.com/scripts/curlTest/upload.php" );
curl_setopt($ch, CURLOPT_POST, 1 );
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$postResult = curl_exec($ch);
if (curl_errno($ch)) {
print curl_error($ch);
}
curl_close($ch);
print "$postResult";
?>[/pre]