Upload an image to a Google spreadsheet

后端 未结 5 977
长情又很酷
长情又很酷 2020-11-30 06:59

I am making a photo shooting contest, the competitor should register using a Google registration form, and upload his photo as well. I searched all over the internet to find

5条回答
  •  生来不讨喜
    2020-11-30 07:47

    Try this

    function insertImage() {
      // Retrieve an image from the web.
      var resp = UrlFetchApp.fetch("http://www.google.com/intl/en_com/images/srpr/logo2w.png");
    
      // Create a document.
      var doc = DocumentApp.openById("");
    
      // Append the image to the first paragraph.
      doc.getChild(0).asParagraph().appendInlineImage(resp);
    }
    

    This link might help you as well :)

    http://code.google.com/googleapps/appsscript/class_documentapp_listitem.html#appendInlineImage

    Happy coding !

提交回复
热议问题