Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

POST file with curl

0 views
Skip to first unread message

gmoeller54

unread,
Feb 6, 2014, 11:25:28 PM2/6/14
to
Greetings,
Kind of stumped - need to post an xml for a remote printer server.
What would be preventing me from posting the xml with the following code?
I've been having a person at the remote server checking logs - nothing hitting the server yet!


$file2 = "xxxxx/$xxxxxFile.xml";

$c = curl_init();
curl_setopt($c, CURLOPT_URL, "http://xxxxxxxx.xxxxxxx.com/xxxxxx/xxxxxReceive.dll");
curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
curl_setopt($c, CURLOPT_POST, true);
curl_setopt($c, CURLOPT_INFILESIZE, filesize($file2));

$fp = fopen($file2, "r");
curl_setopt($c, CURLOPT_INFILE, $fp);

curl_exec($c);

curl_close($c);
fclose($fp);

Thanks!
0 new messages