English 中文(简体)
在 GoogleDocs App 中, Google 文件的文件大小总是 0 (零) (但像 MS Word/Excel 这样的非本地文件没有零大小)
原标题:In GoogleDocs App, file size is always 0 (zero) for google files (but non-native files like MS Word/Excel have non zero size

var 文件 = DocsList.getFolderById( 释放[ 索引] ) get Files ();

  for(i in files){
    /*** Title field ***/
     var title = "<a href=""+files[i].getUrl()+"">"+ files[i].getName() +"</a>";
    /*** Size field ***/
     var size = files[i].getSize();
    /*** Owner field ***/
     var owner = files[i].getOwner().toString().substring(0,files[i].getOwner().toString().indexOf( @ ));

Google 文件( 文件、 演示文稿、 电子表格) 时, 获取 Size 总是返回 0( 0) 。 但从 Google 驱动器资源菜单中, 我能找到字数、 字符数..., 而对于非gogle 文件( 如 Word 或 Excel ) 则显示大小 。

s 这里的方法语法( https:// developmenters.google. com/ apps- script/ class_ file# getSize) 。 大小是否需要某种子字符串或字符串? 我还需要添加什么?

问题回答

正如尼克·约翰逊(Nick Johnson)在评论中所说,这是按原意操作的。在谷歌驱动器界面中,如果你用“使用配额 ” 进行分类,你就会看到谷歌文档和电子表格没有文件大小。





相关问题
How to use year counter google app script?

I need an urgent help i have data as follows in a google sheet i need to add a year counter to the column d as follows using google apps script

What is the daily email limit in Google Apps Script?

Can someone tell me if there is a webpage that lists the official Google limit (Quotas) on emails sent from a Google Apps Script? In testing my little script I got an error: Service invoked too many ...

Reference Error for property of Javascript Object

I have built an object in Javascript on the Google Apps Script engine and every time I run my script I get a reference error saying uName is not defined. Here is the relivant code: function DataSet()...

Run Google Apps Script on Google-Spreadsheet event?

If I create a Google apps script, can I hook it up to Google spreadsheet to run based on an event, or must I manually invoke it? I don t know if Google Sheets supports any events. For example: a ...

Google gadget/spreadsheet: Grab spreadsheet key for gadget

So I m working on a google gadget(really only gadgetizing so I can get a datastore for this) that I want to be embeddable in a google spreadsheet (after this point, I m going to skip the word google - ...

热门标签