本文介绍了有关如何在Google AppMaker中上传文件的示例或模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以与我共享文档批准模板,因为我没有使用GCS但无法打开它,但我想了解他们如何使用Drive Picker小部件上载文件,依此类推.

can anyone share with me the .zip file for Document Approval template because I can't open it since I'm not using GCS but I wanted to go through how they using Drive Picker widget to upload file and so on.

另一件事是,文件将被上传到哪里?是所有者的云端硬盘吗?是否可以将文档上传到 Team Drive 的单个文件夹中?如果有人可以与我分享一些想法或任何API都可以,我真的很感激,谢谢!

another thing is, where the file will be uploaded to? is it the owner's Drive? is it possible to upload the document to a single folder of a Team Drive instead? Really appreciate it if anyone can share with me some thoughts or any API will do, Thanks!

推荐答案

App Maker开箱即用地上传文件的唯一方法是Drive Picker小部件,默认情况下,它将文件上传到当前用户的Drive根文件夹. Drive Picker的API允许更改默认上传文件夹,但是App Maker不允许在此时显示设置. 但是它具有onPickerInit事件,可为您提供 pickerBuilder 可用于自定义选择器:

The only way to upload files that App Maker provides out of the box is Drive Picker widget and by default it uploads files to current user's Drive root folder. Drive Picker's API allows to change default upload folder, however App Maker doesn't expose the setting at this time. But it has onPickerInit event that provides you with pickerBuilder that you can use to customize your the picker:

// onPickerInit Drive Picker's event handler
var uploadView = new google.picker.DocsUploadView();
uploadView.setParent('ID of the folder to upload to');

pickerBuilder.addView(uploadView);

此技巧适用于个人文件夹和Team Drive文件夹.

This trick works both for personal and Team Drive folders.

注意

setParent似乎仅与启用MULTISELECT_ENABLED驱动器选择器功能结合使用.

It seems that setParent works only in combination with MULTISELECT_ENABLED drive picker feature enabled.

这篇关于有关如何在Google AppMaker中上传文件的示例或模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 22:13