title: to attach file from drive to google site with google apps script
body: <p>I'm trying to attach a file from drive to a google site with this script:</p>
  
  <pre><code>  function myFunction() {
  
    var myFolder = DriveApp.getFolderById("0B-hZOMOQnNEDOU9sWEV5SzlXVTQ");
    var myFile = myFolder.getFilesByName("Data.txt").next();
    var myBlob = myFile.getBlob();
  
    var myPage = 
  
    SitesApp.getSiteByUrl("https://sites.google.com/site/demo").getChildByName 
    ("home/demoFileCabinet");
  
    myPage.addHostedAttachment(myBlob);
  
    }
  </code></pre>
  
  <p>All the variables are OK, but "myPage.addHostedAttachment(myBlob)" give me an internal error.
  The most curious thing is that sometimes run OK, but sometimes not. I don´t know what happens.</p>
  
  <p>Could anybody give me some idea?. Thanks!</p>