简体   繁体   中英

Google Apps Script Not Uploading File: NetworkError: Form Submission Failed

So I am trying to upload a file to my drive using Google Apps Script HTML Service. I have achieved a proof of concept, using only the code needed to upload a file to my drive. It uploads successfully. When I try to integrate this code into the project I am working on, which is a form where a user inputs information, selects a file to upload, and clicks submit, the code fails with 'NetworkError: Form Submission Failed'. I have seen other people ask this on other websites, but no one has provided a solution. Has anyone seen this before? I can provide my code if needed.

UPDATE

I figured out what is causing the error. In my project, once the page loads, the Javascript automatically calls:

google.script.run.withSuccessHandler(currentUser).getCurrentUser();

I tested this, and even when the functions getCurrentUser() and currentUser()do not contain any code (example below), I get the NetworkError: Form Submission Failed message. Anyone seen this before?

function currentUser() {

}

function getCurrentUser() {

}

This was an issue which came up around June 20th, 2015. Apparently, if you called a google.script.run function before you uploaded the form, the program would fail. It has since been resolved. The code works fine now.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM