Web 应用程序未部署:抱歉,目前无法打开文件 [英] Web app doesn't deploy: Sorry, unable to open the file at present

查看:33
本文介绍了Web 应用程序未部署:抱歉,目前无法打开文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 Google 表格中有一个 AppsScript,我想将其部署为 Web 应用程序(我以前做过很多次).我已将其部署为公开(任何人,甚至匿名),链接如下:抱歉,目前无法打开文件.请检查地址并重试."

I have a AppsScript in my Google Sheet that I want to deploy as a WebApp (something I've done many times before). I have deployed it as public (Anyone, even anonymous), and the link comes up with: "Sorry, unable to open the file at present. Please check the address and try again."

当我点击Test web app for your latest code"时也会发生这种情况

This also happens when I click "Test web app for your latest code"

脚本在电子表格中完美运行,我的部署代码是:

The script works perfectly from within the spreadsheet, and my deployment code is:

    function doGet() {
  return HtmlService.createTemplateFromFile('Weekly.html')
      .evaluate();
}

function onOpen() {
  var Menu = SpreadsheetApp.getUi() // Or DocumentApp or FormApp.
      .createMenu('Survey');
      Menu.addItem('Run Survey', 'doSurvey')
        .addToUi();
}

function doSurvey() {
  var html = HtmlService.createTemplateFromFile('Weekly.html')
      .evaluate();
  SpreadsheetApp.getUi() // Or DocumentApp or FormApp.
      .showModalDialog(html, ' ');
}

有什么提示吗?谢谢!

推荐答案

这个问题已经在这个github 论坛:无法提交表单,收到抱歉,目前无法打开文件."

This problem has been resolved in this github forum: Can't submit the form, Receiving "Sorry, unable to open the file at present."

建议的解决方案是:

just remove the user part of the URL should work too, e.g. for the OP:

https://script.google.com/macros/s/AKfycbyO4vXIPrq4smOSFpUzyQSuOxvJE9YWqlND6GfyZ3Y2lR-pPMk/exec

we should add this to the tutorial, I suppose. also relevant for some gsuite users:
https://stackoverflow.com/questions/26153872/cant-make-a-google-apps-script-publish-for-anonymous-users

这篇关于Web 应用程序未部署:抱歉,目前无法打开文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆