Try this..

curl_setopt($curl_handle, CURLOPT_POSTFIELDS, array("image" =>
"@$new_image;type=image/png"));

I have never tried this myself, but I have seen some other people say
that it is needed on some servers to set the proper content-type.

-Chad

On Wed, Oct 14, 2009 at 11:15 PM, TylerC <tyle...@gmail.com> wrote:
>
> In this case it was /home/49090/domains/*******/html/clients/****/
> tools/avatars/city_ninja.png
>
> On Oct 14, 11:10 pm, Chad Etzel <c...@twitter.com> wrote:
>> Most likely the content-type is not being set correctly. What is the
>> value of $new_image?
>> -Chad
>>
>> On Wed, Oct 14, 2009 at 10:29 PM, TylerC <tyle...@gmail.com> wrote:
>>
>> > Hey all I am having trouble getting Twitter to update profile
>> > avatars... From what I can tell I have the API calls straight but when
>> > I go to Twitter there is no avatar image and when I right click it and
>> > then click view image I get the following:
>>
>> > <Error>
>> > <Code>AccessDenied</Code>
>> > <Message>Access Denied</Message>
>> > <RequestId>5C34DBD155FA0052</RequestId>
>> > -
>> > <HostId>
>> > Rd/SKr0AUrZiiT3K0jLhhVZ3EpVqWRKbP8NSlc26gQn21WIqkl7E9roK/ZaUFEfg
>> > </HostId>
>> > </Error>
>>
>> > Here is my API call, the image being sent is a gif much smaller than
>> > 700kb and its the absolute path...
>>
>> > $url = 'http://twitter.com/account/update_profile_image.xml';
>>
>> > $curl_handle = curl_init();
>>
>> > 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" => "@
>> > $new_image"));
>>
>> > curl_setopt($curl_handle, CURLOPT_USERPWD, "$username:$password");
>>
>> > $buffer = curl_exec($curl_handle);
>>
>> > curl_close($curl_handle);
>>
>> > echo $buffer;
>>
>> > Everything is returned properly with no errors but yet no image
>> > appears for the avatar just a blank space. Oddly enough the image name
>> > on the profile page is correct but it will not show...
>>
>> > Any ideas this is really pissing me off!?
>>
>> > Thanks!
>

Reply via email to