JavaScript Handling multiple files from an input element in an array with Google Apps Script handling multiple files in python,handling multiple files in vi,

I have a form, which allows to select an item from a dropdown list and upload a file. The name and the ID of the item are saved in a Spreadsheet document. Works with one file...but I want to upload multiple files. Could you help me fixing the script?

The HTML part looks like this

<div class="col-md-4 col-sm-6 ">
           <div class="caption">
             <h3>Bildauswahl</h3>
             <p align="center"><input type="file" name="myFiles[]" id="myFiles" multiple></p>
         </div>
         </div>

My script, which is not working, is the following:

var dropBoxId = "XYZ"; 
var logSheetId = "ABC";

function doGet(e) {
  return HtmlService.createHtmlOutputFromFile('InputForm.html');
}

function uploadFiles(formObject) {
  try {
    // Create a file in Drive from the one provided in the form
    var folder = DriveApp.getFolderById(dropBoxId);
    var input = document.getElementById('myFiles');

    for (i = 0; i<input.files.length; i++) {
      var blob = input.files[i];
      var file = folder.createFile(blob);
      var ss = SpreadsheetApp.openById(logSheetId);
      var sheet = ss.getSheets()[0];
      sheet.appendRow([file.getName(), file.getUrl(), formObject.myName]);
    }


    // Return the new file Drive URL so it can be put in the web app output
    return file.getUrl();
  } catch (error) {
    return error.toString();
  }
}

Thanks.

Answer:1

I am following a tutorial [here][1] to make a Facebook like friend tagging system. But the tutorial lacks the "arrow navigating" capability like Facebook. I would like to figure out how to achieve ...

I am following a tutorial [here][1] to make a Facebook like friend tagging system. But the tutorial lacks the "arrow navigating" capability like Facebook. I would like to figure out how to achieve ...

  1. enable arrow navigation in excel
  2. how to enable arrow navigation

I am using Trisquel 7.0. I've some basic knowledge about html and JavaScript. Now I want to save html form data to file (Also interested in loading/filling html form from file). I searched and found ...

I am using Trisquel 7.0. I've some basic knowledge about html and JavaScript. Now I want to save html form data to file (Also interested in loading/filling html form from file). I searched and found ...

  1. saving html form data to text file
  2. saving html form data to xml
  3. saving html form data
  4. saving html form data to xml using javascript
  5. saving html form data to file
  6. saving html form data to xml using php
  7. html saving form values
  8. html form using php

Setup: leftItems & rightItems are arrays of 5 digit ID's. matchedItems is an array of all those ID's - there a lots of results with the same ID. $matches is a div to which I want to append results ...

Setup: leftItems & rightItems are arrays of 5 digit ID's. matchedItems is an array of all those ID's - there a lots of results with the same ID. $matches is a div to which I want to append results ...

I'm trying to display the time it takes a function to complete in javascript, and then display the time in an alert window that is called on button click, however the alert box doesn't pop up at all ...

I'm trying to display the time it takes a function to complete in javascript, and then display the time in an alert window that is called on button click, however the alert box doesn't pop up at all ...

  1. display http request
  2. display http request headers
  3. display http request online
  4. display http request java
  5. wireshark display http request
  6. tcpdump display http request
  7. chrome display http request
  8. php display http request
  9. tshark display http request
  10. firefox display http request
  11. wireshark display filter http request uri