title: HTTP POST and Google Apps Script file upload
body: <p>Forgive the possible duplicity of this question, but after hours of searching to no avail, I've elected to ask the following of the community:</p>
  
  <p>Is there any means by which, using the following form with HTML and Javascript (with a POST  or GET request) that I might be able to have a user, from a normal HTML page, be able to submit and upload a file to Google Drive by means of having the "form action =" being directed at a Google Script?</p>
  
  <p>I have been able to successfully write values to a Google Spreadsheet using only a form action directed to a Google Script which holds a single doPost(e) which then grabs the e.parameter.[input_field_name_here] and performs the calculations.</p>
  
  <p>I have been toying with a combination of methods, but this is about as far as I've been able to get.</p>
  
  <p><strong>Current HTML:</strong></p>
  
  <pre><code>&lt;form method="post" action="my_google_script_published_as_web_app_url/exec" name="quoteForm" id="quoteForm" target="hidden_iframe"&gt; 
    &lt;input type="file" name = "thefile"&gt;
  &lt;/form&gt; 
  </code></pre>
  
  <p><strong>Google Apps Script</strong></p>
  
  <pre><code>function doPost(e) 
     {
     var fileBlob = e.parameter.thefile;
     Logger.log(e);
     Logger.log(fileBlob);
     var doc = DocsList.createFile(fileBlob.getBlob());
     }
  </code></pre>
  
  <p>I have attempted the following variations with the code in order to try to perform an upload via this method:</p>
  
  <ul>
  <li>Added the <code>enctype="multipart/form-data"</code> to the form to see if that was an issue.</li>
  <li>Attempted to use a "GET" request instead.</li>
  </ul>
  
  <p>The closest I have been able to get in terms of an acutal useable result is an error return of "unable to convert Array to BlobSource" and, a further result of "unable to to call .getBlob() on type string" as well as "...on type Object".</p>
  
  <p>Is there any hope to this at all? I've been trying to glean what I could from here, as well as the following two issues regarding what sounds like bugs related to a method like this <a href="https://code.google.com/p/google-apps-script-issues/issues/detail?id=2229" rel="nofollow">here</a> and <a href="https://code.google.com/p/google-apps-script-issues/issues/detail?id=1660" rel="nofollow">here</a> with the latter seeming the closest to what I'm facing.</p>
  
  <p>Many thanks in advance for any assistance on this matter.</p>