How are you authenticating the user via the API?  OAuth, AuthSub, etc?

Whatever way you are authenticating to send the file, you have to use the same 
method to make additional requests.

If you post your function that uploads your image, it might shed some light on 
the problem.

Lee


Lee Evans
ClearTours, Inc.

-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of marciniasty
Sent: Tuesday, January 05, 2010 11:37 AM
To: Google Picasa Web Albums API
Subject: [PWA API] cURL affects gdata api

i'm using curl function in my code. Before running my method with curl i can 
post image to picasa, after it i can't (Expected response code 200, got 400 
Multipart must have Atom and media part). in the bad message wireshark is not 
recognising last bytes as 'last boundary' but as http data ;-/.

my method using curl:

protected function _sendQuery($message, $uploadFile = '', $downloadFile = '') {
                $curl = curl_init(APIURL);
                $headers = array('query' => $message);
                curl_setopt($curl, CURLOPT_POST, true);
                curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
                curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
                if(!empty($uploadFile) && file_exists($uploadFile))
                        $headers['media'] = '@'.$uploadFile;
                else if(!empty($downloadFile)) {
                        $file = fopen($downloadFile, "w+");
                        if(!$file)
                                throw new Exception("File $downloadFile cannot 
be created");
                        curl_setopt($curl, CURLOPT_FILE, $file);
                }
                curl_setopt($curl, CURLOPT_POSTFIELDS, $headers);
                if(isset($file)) {
                        curl_exec($curl);
                        fclose($file);
                        curl_close($curl);
                        unset($curl);
                        return (bool) filesize($downloadFile);
                }
                else {
                        $response = curl_exec($curl);
                        curl_close($curl);
                        unset($curl);
                        return $response;
                }
        }

what is wrong? why it affects gdata api? :-| thanks for reply
-- 
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.


Reply via email to