title: writing content of local file to blob using javascript
body: <p>I am trying to upload an excel file(named test1.xls) present in my computer in c drive at location->C:\test\test1.xls to google site(<a href="https://sites.google.com/xyz).To" rel="nofollow">https://sites.google.com/xyz).To</a> do so, I am using Google script editor and code shown below. The issue is that I am not able to pass the contents of file test1.txt at location C:\test\test1.txt instead of the text ("Here is some data")shown in code line shown below(var blob = Utilities.newBlob("Here is some data", "text/plain", "test1.xls");).Also what needs to be given instead of "text/plain" as it is excel file.Please let me know how to do that with code as I am new to google scripting/api coding,many thanks in advance.</p>
  
  <p>CODE-></p>
  
  <pre><code>function doPost(e) {
  var site = SitesApp.getSiteByUrl("https://sites.google.com/xyz"); Logger.log(site.getName()); 
  
   var page = site.getChildren()[0];
  
   // Create a new blob and attach it. Many useful functions also return
   // blobs file uploads, URLFetch
   var blob = Utilities.newBlob("Here is some data", "text/plain", "test1.xls");
  
  try {
   // Note that the filename must be unique or this call will fail
  
   page.addHostedAttachment(blob);
   }
    catch(e){
      Logger.log('Hosted attachment error msg:' +e.message);
      }
    }
  </code></pre>