2009/1/6 James N. Weber <[email protected]>:
>
> Thanks for the help, Chad. I think I need the PHP equivalent of -F in
> curl- I'm not sure how to set that.
>
> I tried changing it to CURLOPT_POSTFIELDS, and Twitter gave me a
> "Something is technically wrong." page- the robot lobster with a
> broken claw.
> Any ideas?
The code I took the below line from is not uploading an image to
Twitter, but rather between two internal servers on one of the sites I
maintain and it works fine for me...
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect: '));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, array('img' => '@'.$filename));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
Hope it helps you.
-Stuart
--
http://stut.net/