title: Uploading file using Google Apps Script using HtmlService
body: <p>How can I upload files to google drive?
  I want to create a web app using google app script - htmlservice. 
  I don't know how to point form in html to existing google app script.
  I am having hard time to find a right example in google documentation. </p>
  
  <p>I found hundreds of examples using UI but according to <a href="https://developers.google.com/apps-script/sunset" rel="noreferrer">https://developers.google.com/apps-script/sunset</a> it will be deprecated soon.
  Thank you in advance!
  Janusz</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  &lt;form&gt;
     &lt;input type="file"/&gt;
     &lt;input type="button"&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Script</p>
  
  <pre><code>function doGet() {
    return HtmlService.createHtmlOutputFromFile('myPage');
  }
  
  function fileUploadTest()
  {
     var fileBlob = e.parameter.upload;
        var adoc = DocsList.createFile(fileBlob);
        return adoc.getUrl();
  }
  </code></pre>