I am trying to upload files to Google Drive using Google Apps script that also deployed as web app.
In the .html file I got -
<form id="myForm" action='#' method='post' enctype="multipart/form-data" >
<input type="file" name="filesToUpload[]" id="filesToUpload" multiple="" />
<input type="submit" value="Upload File"
onclick="this.value='Uploading..';
google.script.run.uploadFiles(this.parentNode)" id="upload-button">
In the .gs file I got -
function uploadFiles(form) {
var file = form['filesToUpload[]'];
I have deployed web app with this code(not only this code of-course).
Each time i upload more then one file in the web app, the variable - 'file' contain only the first file i had uploaded. and not all the files. In other words the fileUpload objects contain each time I have tried the fileUpload-dictionary contain only one file.
fileUpload class - https://developers.google.com/apps-script/reference/ui/file-upload
I read a lot of documentation and I begun to think that it's impossible to upload multiple files using Google apps script(while choosing multiple files in one input of course).
Anyone knows something about it?
Thanks in advance!