我正在尝试使用 Zend Framework 从 Google Docs 中名为“myfolder”的文件夹中检索文档列表。
$service = Zend_Gdata_Docs::AUTH_SERVICE_NAME;
$client = Zend_Gdata_ClientLogin::getHttpClient("my@gmail.com", "password", $service);
$docs = new Zend_Gdata_Docs($client);
$feed = $docs->getDocumentListFeed('https://docs.google.com/feeds/documents/private/full/-/myfolder');
$this->view->feed = "";
foreach ($feed as $document) {
$link = $document->getLink();
$this->view->feed .= '<a href="'.$link[0]->getHref().'" target="_blank">'.$document->getTitle().'</a><br/>';
}
我能够获得“myfolder”中所有文件的列表;但是当我尝试打开它们时,出现错误:
需要授权
错误 401
我试过使用
https://docs.google.com/feeds/documents/private/full
代替
https://docs.google.com/feeds/documents/private/full/-/myfolder
我可以看到我所有的文件。我可以毫无问题地打开保存在“主”目录下的那些。仅当我尝试打开保存在文件夹中的文件时,才会出现错误 401。
为什么?任何的想法?