Here is my curlopt's- curl_setopt($curl_handle, CURLOPT_URL, "$url"); curl_setopt($curl_handle, CURLOPT_POST, 1); curl_setopt($curl_handle, CURLOPT_HTTPHEADER, array('Expect:')); curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2); curl_setopt($curl_handle, CURLOPT_POSTFIELDS, array('image' => '@'. $image)); curl_setopt($curl_handle, CURLOPT_USERPWD, "$username:$password");
Twitter isn't returning anything at all now. The $buffer variable from "$buffer = curl_exec($curl_handle);" is coming back empty. Thanks for your help! On Jan 6, 1:15 pm, Stuart <stut...@gmail.com> wrote: > 2009/1/6 James N. Weber <jame...@gmail.com>: > > > > > 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/