DocsUploadView Google Teamdrives

时间:2018-12-14 09:50:22

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

如何创建一个允许我将文件上传到团队驱动器中不同文件夹的选择器?这是我的代码:

function createPicker(token) {

    if (pickerApiLoaded && token) {
        var Teamdrivesview = new google.picker.DocsView()
            //.setIncludeFolders(true)
            .setSelectFolderEnabled(true)
            .setEnableTeamDrives(true); 

        var docsView = new google.picker.DocsView()
            .setIncludeFolders(true)
            .setSelectFolderEnabled(true)
            .setEnableTeamDrives(true);

        var uploadView = new google.picker.DocsUploadView()
            .setIncludeFolders(true)

        var picker = new google.picker.PickerBuilder()
            .addView(docsView)
            .addView(Teamdrivesview)
            .addView(uploadView)
            .enableFeature(google.picker.Feature.SUPPORT_TEAM_DRIVES)
            .enableFeature(google.picker.Feature.NAV_HIDDEN)


            .hideTitleBar()
            .setSize(DIALOG_DIMENSIONS.width - 2, DIALOG_DIMENSIONS.height - 2)
            .setOAuthToken(token)
            .setCallback(pickerCallback)
            .setOrigin('https://docs.google.com')
            .build();

        picker.setVisible(true);

    } else {
        showError('Unable to load the file picker.');
    }
}

这允许我查看所有文件夹,但是不允许我上传任何东西。似乎它忽略了uploadView。

我的目标是创建一个脚本,该脚本允许我将文件上传到团队驱动器中的其他文件夹。这可能吗?我进行了一些研究,似乎上传并没有太多内容,仅查看和选择文件即可。

0 个答案:

没有答案