如何在doGet之外获取URL字符串参数?

时间:2018-05-08 11:09:42

标签: javascript html google-apps-script google-apps

我的Google Apps脚本中有doGet方法。我在网址中传入folderId参数,然后我可以使用第一个参数在doGet方法内以e.parameters.folderId的方式访问它。

但是,我的Google Apps脚本会上传一个文件,我希望此参数可供upload方法使用,我的页面在尝试上传文件时会调用该方法:

<button onclick="google.script.run.upload(this.parentNode);">ok</button>

我试图将它作为第二个参数传递给此方法,但后来我收到了这个错误:

Uncaught Error: Forms with file inputs must be the only parameter.
  at ...

如何从folderId方法中访问upload值?

提前致谢。

0 个答案:

没有答案