1

I'm currently trying to implement Google Docs to a website. I'm using Zend Framework by the way and I'm using the Zend GDocs API.

My question is - how can I get the file extension of any files and documents? It's no problem getting a list of the files, but i really need the file extension too.

$docs = new Zend_Gdata_Docs($client);       
$feed = $docs->getDocumentListFeed($url);
$this->view->feed = $feed;

foreach($this->feed as $item) {
    echo $item->getTitle();
}

Thanks for your help and time.

Steffen

Ali Afshar
  • 40,967
  • 12
  • 95
  • 109
d4ta
  • 75
  • 1
  • 6

2 Answers2

0

Do a substr starting on the last character of the file, going back, until you encounter a '.' (dot)-character.

0

Use the files.list method of Google Drive API instead, then look at the fileExtension field of the File resources.

Ali Afshar
  • 40,967
  • 12
  • 95
  • 109