【问题标题】:How to get the file extension of files in Google Docs?如何获取 Google Docs 中文件的文件扩展名?
【发布时间】:2012-07-04 05:44:29
【问题描述】:

我目前正在尝试在网站上实施 Google 文档。顺便说一句,我正在使用 Zend Framework,我正在使用 Zend GDocs API。

我的问题是 - 如何获取任何文件和文档的文件扩展名? 获取文件列表没有问题,但我也确实需要文件扩展名。

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

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

感谢您的帮助和时间。

史蒂芬

【问题讨论】:

    标签: zend-framework google-docs-api google-drive-api zend-gdata


    【解决方案1】:

    从文件的最后一个字符开始执行 substr,然后返回,直到遇到 '.' (点)-字符。

    【讨论】:

      【解决方案2】:

      改用 Google Drive API 的files.list 方法,然后查看File 资源的fileExtension 字段。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2014-04-14
        • 2011-04-04
        • 2012-07-23
        • 2017-12-22
        • 2014-07-01
        • 2013-05-28
        • 1970-01-01
        相关资源
        最近更新 更多