473,395 Members | 1,568 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Picasa API Issues

162 100+
Im trying to do a basic upload to my Picasa album. I've tried the example in the documentation and one found on another site. Both fail with no error at the last step, a call to

Expand|Select|Wrap|Line Numbers
  1. insertPhotoEntry()
Zend is set up correctly and pathing is correct. I know this because the test script they provide comes back all tests ok.

Any ideas why? Below is the test script

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html 
  2.   PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  3.   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  5.   <head>
  6.     <title>Adding photos to an album</title>
  7.     <style>
  8.     body {
  9.       font-family: Verdana;      
  10.     }
  11.     li {
  12.       border-bottom: solid black 1px;      
  13.       margin: 10px; 
  14.       padding: 2px; 
  15.       width: auto;
  16.       padding-bottom: 20px;
  17.     }
  18.     h2 {
  19.       color: red; 
  20.       text-decoration: none;  
  21.     }
  22.     span.attr {
  23.       font-weight: bolder;  
  24.     }
  25.     </style>    
  26.   </head>
  27.   <body>
  28.     <h1>Add Photo</h1>
  29.     <?php if (!isset($_POST['submit'])) { ?>
  30.     <form method="post" action="<?php 
  31.      echo htmlentities($_SERVER['PHP_SELF']); ?>" enctype="multipart/form-data">
  32.       Title: <br/>
  33.       <input name="title" type="text" size="25" /><p/>
  34.       File to upload: <br/>
  35.       <input name="photofile" type="file" /><p/>      
  36.       Tags: <br/>
  37.       <input name="tags" type="text" size="25" /><p/>
  38.       <input name="submit" type="submit" value="Save" />
  39.     </form>
  40.     <?php
  41.     } else {
  42.       // load classes
  43.       $clientLibraryPath = '/var/www/vhosts/sitename.com/httpdocs/standards/ZendGdata-1.10.0/library/';
  44.       $oldPath = set_include_path(get_include_path() . PATH_SEPARATOR . $clientLibraryPath);
  45.       require_once 'Zend/Loader.php';
  46.       Zend_Loader::loadClass('Zend_Gdata');
  47.       Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
  48.       Zend_Loader::loadClass('Zend_Gdata_Photos');
  49.       Zend_Loader::loadClass('Zend_Http_Client');
  50.  
  51.       // connect to service
  52.       $svc = Zend_Gdata_Photos::AUTH_SERVICE_NAME;
  53.       $user = "userid@gmail.com";
  54.       $pass = "secret";
  55.       $client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $svc);
  56.       $gphoto = new Zend_Gdata_Photos($client);
  57.  
  58.       // validate input
  59.       if (empty($_POST['title'])) {
  60.         die('ERROR: Missing title');
  61.       } 
  62.  
  63.       // sanitize input
  64.       $title = htmlentities($_POST['title']);
  65.       $tags = htmlentities($_POST['tags']);
  66.  
  67.       // set album name
  68.       $albumName = "France2008";
  69.  
  70.       // construct photo object
  71.       // save to server      
  72.       try {        
  73.         $photo = $gphoto->newPhotoEntry();
  74.  
  75.         // set file
  76.         $file = $gphoto->newMediaFileSource($_FILES['photofile']['tmp_name']);
  77.         $file->setContentType("image/jpeg");
  78.         $photo->setMediaSource($file);
  79.  
  80.         // set title
  81.         $photo->setSummary($gphoto->newSummary($title));
  82.  
  83.         // set tags
  84.         $photo->mediaGroup = new Zend_Gdata_Media_Extension_MediaGroup();
  85.         $keywords = new Zend_Gdata_Media_Extension_MediaKeywords();
  86.         $keywords->setText($tags);
  87.         $photo->mediaGroup->keywords = $keywords;
  88.  
  89.         // link to album
  90.         $album = $gphoto->newAlbumQuery();        
  91.         $album->setUser($user);
  92.         $album->setAlbumName($albumName);
  93.  
  94.         // save photo
  95.         $gphoto->insertPhotoEntry($photo, $album->getQueryUrl()); 
  96.       } catch (Zend_Gdata_App_Exception $e) {
  97.         echo "Error: " . $e->getResponse();
  98.       }
  99.       echo 'Photo successfully added!';      
  100.     }
  101.     ?>
  102.   </body>
  103. </html>    
  104.  
Mar 11 '10 #1
1 2196
Markus
6,050 Expert 4TB
You'd be better off asking on the developers group/list.
Mar 11 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Tom Loredo | last post by:
Hi folks- I'm about to move from a Solaris 8/SPARC environment to a Dell running RedHat 9. Are there any issues I need to be aware of in bringing my Python code over (mostly scientific...
28
by: grahamd | last post by:
Who are the appropriate people to report security problems to in respect of a module included with the Python distribution? I don't feel it appropriate to be reporting it on general mailing lists.
5
by: sandy | last post by:
Hi All, I am a newbie to MySQL and Python. At the first place, I would like to know what are the general performance issues (if any) of using MySQL with Python. By performance, I wanted to...
2
by: malcolm | last post by:
Hello, We have a robust (.NET 1.1 c# winforms) client-server application that utilizes many typed DataSets, typed DataTables and typed DataRows. Our application is a series of windows and popup...
1
by: Aliandro | last post by:
Hi Does any one know where I can find information regarding any issues with SQL and IIS being run under windows XP SP2? as I am in the process of programmning in Dot net and neet some way of...
1
by: Thomas W | last post by:
I know this is slightly off-topic, but since Python is hot at Google and several key members from the python community works there, I was hoping to get some help on this subject. I want to...
1
by: GaryDean | last post by:
We have been developing all of our .net applications on 32 bit windows using 32 bit SQL Server. We are being asked to now deploy to servers running 64bit windows and 64bit SQL Server. Are there...
3
by: eschneider | last post by:
Just some common issues with WS: Using custom objects: When objects change, seems you are always fixing some issue. Update references, which sometimes does not work. Deployment: Weird errors...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.