Re: Changing profile image via PHP/Curl

2009-02-07 Thread Noah
I owe you guys a beer. This really helped! On Jan 6, 4:26 pm, "Chad Etzel" wrote: > We figured this out off-list, but I'm posting the fix for completeness: > > For some reason $newfilename was missing a "." in the filename before "jpg". > > try tweaking this line: > $newfilename = substr($tmpfil

Re: Changing profile image via PHP/Curl

2009-01-19 Thread Kevin Thompson
I'm having the same problem as James with the pastebin script. "There was a problem with your picture. Probably too big." Additionally, I came across this thread having a similar error with the api returning a 500 server error when attempting to update a user profile image. My code is using PHP G

Re: Changing profile image via PHP/Curl

2009-01-06 Thread Chad Etzel
We figured this out off-list, but I'm posting the fix for completeness: For some reason $newfilename was missing a "." in the filename before "jpg". try tweaking this line: $newfilename = substr($tmpfilename, 0, strlen($tmpfilename) - strlen($ext)) . $ext; to $newfilename = substr($tmpfilename,

Re: Changing profile image via PHP/Curl

2009-01-06 Thread James N. Weber
Chad- Thanks for all your help with this! I downloaded it from pastebin, and then uploaded it to my server, no changes. It is giving me the "There was a problem with your picture. Probably too big." error still, with several photos. Any ideas what's going on? On Jan 6, 1:31 pm, "Chad Etzel" wrot

Re: Changing profile image via PHP/Curl

2009-01-06 Thread James N. Weber
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

Re: Changing profile image via PHP/Curl

2009-01-06 Thread Chad Etzel
So after some fiddling with your code, I got it to work: I think part of the problem was that you can't use URLs to the image (like you were doing). Anyway, the following code (see pastebin link) gives examples of how to do it with File Uploading through a form, or just using canned local images

Re: Changing profile image via PHP/Curl

2009-01-06 Thread Stuart
2009/1/6 James N. Weber : > > 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 ide

Re: Changing profile image via PHP/Curl

2009-01-06 Thread James N. Weber
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? James On Jan 6, 11:48 am, "Chad Etz

Re: Changing profile image via PHP/Curl

2009-01-06 Thread Chad Etzel
Ah, my fault, I misread that line of code... it does look like you are setting CULROPT_FILENAME, but I don't think that does what you are wanting it to do from reading http://us3.php.net/manual/en/function.curl-setopt.php -Chad On Tue, Jan 6, 2009 at 1:44 PM, Chad Etzel wrote: > It looks like yo

Re: Changing profile image via PHP/Curl

2009-01-06 Thread Chad Etzel
It looks like you are submitting the actual string "http://up.jamesnweber.com/Whe.jpg"; as the value of $image, whereas I believe you need to actually send the image file data (i.e. the binary image data) in the request instead. I have not done this before, so I am not sure about what encoding to

Changing profile image via PHP/Curl

2009-01-06 Thread James N. Weber
I'm trying to develop a web site form that allows you to choose a profile picture, enter your username&password, and then it will change your profile pic to the selected one. I haven't implemented the choosing of the picture yet, as I'm still trying to get one picture to go through. I keep getting