如何允许所有/任何扩展程序文件在Google云端硬盘中上传

时间:2017-10-20 08:06:51

标签: google-apps-script google-drive-api

如何允许所有/任何扩展程序文件从网络应用程序上传到Google云端硬盘选择器?

我允许

mimeTypes: "image/png,image/jpeg,image/jpg,application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/msword,application/msword", 

我无法上传金山词霸文件(xlsx)

function initPicker() {
  return {
    locale: 'en',
    token: ScriptApp.getOAuthToken(),
    origin: "https://script.google.com",
    parentFolder: "0B0Oj_1v-CAzNYmFMRkVUZjd0aHM",
    developerKey: "AIzaSyBno-75vfzpW0hnBfagPrU1o5PxZ1yc8C8",
    dialogDimensions: {
      width: 600, 
      height: 425
    },
    picker: {
      viewMode: "LIST",
      mineOnly: true,
      mimeTypes: "image/png,image/jpeg,image/jpg,application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/msword,application/msword",
      multiselectEnabled: true,
      allowFolderSelect: true,
      navhidden: true,
      hideTitle: true,
      includeFolders: true,
    }
  };
}

1 个答案:

答案 0 :(得分:1)

您只需删除mimeTypes属性,然后就可以上传任何类型的文件。

picker: {
      viewMode: "LIST",
      mineOnly: true,
      multiselectEnabled: true,
      allowFolderSelect: true,
      navhidden: true,
      hideTitle: true,
      includeFolders: true,
    }