Now it works fine.. Same code.. The problem I think it was on Picasa API
On Jul 13, 2:50 pm, caiofab <[email protected]> wrote: > I've tried but no success.. > > First i get the Auth token: > > //-- CODE > $getauth = "https://www.google.com/accounts/ClientLogin?Email=". > $login."&Passwd=".$pass."&service=lh2"; > $ch = curl_init(); > curl_setopt($ch, CURLOPT_URL, $getauth); > curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); > curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); > $auth = curl_exec($ch); > $auth = explode("Auth=", $auth); > $auth = $auth[1]; > curl_close($ch); > # OK, i have the auth > //-- END_OF_CODE > > Then, I have to send a POST with my image data: > > //-- CODE > $postimg = "http://picasaweb.google.com/data/feed/api/user/caiofab/ > albumid/5356961900075782257"; > $header = array("Content-Type: image/jpeg", > "Content-Length: ".filesize($file), > "Authorization: GoogleLogin auth=$auth" > ); > $ch = curl_init(); > curl_setopt($ch, CURLOPT_URL, $postimg); > curl_setopt($ch, CURLOPT_POST, 1); > curl_setopt($ch, CURLOPT_HTTPHEADER, $header); > curl_setopt($ch, CURLOPT_POSTFIELDS, file_get_contents($file)); > curl_exec($ch); > curl_close($ch); > //-- END_OF_CODE > > Now it returns me a error message "Not an image." > > Can someone help me? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Picasa Web Albums 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-Picasa-Data-API?hl=en -~----------~----~----~----~------~----~------~--~---
