Google Picker API DocsUploadView setIncludeFolders无效

时间:2014-07-16 17:45:26

标签: javascript google-drive-api google-picker

我有以下内容:

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

        var picker = new google.picker.PickerBuilder().
            addView(uploadView).
            setOAuthToken(oauthToken).
            setDeveloperKey(googleDeveloperKey).
            setCallback(uploadPickerCallback).
            build();

        picker.setVisible(true);

在此过程中没有任何地方会询问目的地,它只会上传到根目录并在文件上传后关闭对话框。

1 个答案:

答案 0 :(得分:1)

此问题是由Picker API的长期错误引起的。有关详细信息,请参阅https://groups.google.com/forum/#!topic/google-picker-api/xaHcET7JYLw

解决方法是启用多选,如https://developers.google.com/picker/docs/reference#Feature中的文档中所述。

picker.enableFeature(google.picker.Feature.MULTISELECT_ENABLED);