For the past two years, my Google Apps Script connected to a spreadsheet has been working flawlessly. I created an HTML form to upload CSV and Excel files for processing and data loading into the spreadsheet. However, since March 2020, file uploading has been failing.
Upon submitting the upload form, I receive the following message:
Unfortunately, a server error has occurred. Please wait a moment and try again.
I've noticed that the server-side function is not being called at all. Removing the file input field from the form allows everything else to work properly; however, without the file blob, the server-side function cannot be executed.
I have not made any modifications to the script in the last six months, so I suspected that something may have changed in the google.script.run function, but my search yielded no results.
I also attempted using different files that had previously been successfully uploaded, only to encounter the same error.
Below is my form:
<form id="uploadForm" onsubmit="uploadCsvClient(this)">
<input name="fileToUpload" type="file"/>
<input type="submit" value="Upload"/>
</form>
The client-side script is as follows:
function uploadCsvClient(formObject) {
google.script.run.withSuccessHandler(uploadSuccess)
.withFailureHandler(onFailure)
.uploadCsv(formObject);
}
Have there been any changes in Google Apps Script that I should be aware of? What could potentially be causing this issue? Any assistance would be greatly appreciated as I am feeling quite lost...