Hi Sebastian,

Here is a simple PHP curl example:

<?php

$link_photo = "http://www.google.com/m8/feeds/photos/media/domain.com/
3c5fd34b888e075f";
$token = "DQAAAI0AAA...";

$header_array[0]="Content-Type: application/x-www-form-urlencoded";
$header_array[2]="Authorization: GoogleLogin auth=". $token;

$ch = curl_init($link_photo);

curl_setopt($ch, CURLOPT_HTTPHEADER, $header_array);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_FORBID_REUSE, TRUE);
curl_setopt($ch, CURLOPT_HEADER, 1);

$response = curl_exec($ch);

$header_size = curl_getinfo($ch,CURLINFO_HEADER_SIZE);
$header = substr($response, 0, $header_size);
$body = substr( $response, $header_size );
$http_code= curl_getinfo($ch,CURLINFO_HTTP_CODE);
$content_type= curl_getinfo($ch,CURLINFO_CONTENT_TYPE);

curl_close($ch);

header("Content-type: ".$contentType);
print_r( $body );

?>

On Oct 1, 12:58 pm, "Julian (Google)" <[email protected]> wrote:
> Hi,
>
> Using Zend you can do the following:
>
> $rawImage2 = file_get_contents("photo2.jpg");
> $link_photo_edit = 'http://www.google.com/m8/feeds/photos/media/user
> %40domain.com/0/g2B66Nd0Hj9kBIDs0lZCxQ';
> $client2 = Zend_Gdata_ClientLogin::getHttpClient("[email protected]",
> "PASS", "cp");
> $token = $client2->getClientLoginToken();
> $client2->setUri($link_photo_edit);
> $client2->setHeaders( array("Content-type: image/jpeg","Authorization:
> GoogleLogin auth=".$token, "Content-length: ".strlen($rawImage2)) );
> $client2->setRawData($rawImage2);
> $http_response2 = $client2->request('PUT');
>
> I do not have any curl example at hand, however it should be really
> similar. I'll try to post one.
>
> Cheers,
> Julian.
>
> On Sep 30, 2:49 pm, alex <[email protected]> wrote:
>
> > using php forgot to say
>
> > > ok now a even stranger question...and i belive more stupid than the
> > > first.
> > > can anyone point me to a tutorial for updating a contat photo? I
> > > really didn't find one. Please Help.
>
> > > thanks
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Contacts API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-contacts-api?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to