将图片上传到Google电子表格 [英] Upload an image to a Google spreadsheet

查看:376
本文介绍了将图片上传到Google电子表格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在拍摄照片比赛,竞争对手应该使用Google注册表格进行注册,并上传他的照片。我搜索了整个互联网,找到一个Google脚本,可以插入到表单中以使用Google表单上传文件,但找不到任何内容。它是可行的,如何,甚至可以有其他的想法来做这样的事情,请让我知道。 试试这个

 函数insertImage(){
//从网络中检索图像。
var resp = UrlFetchApp.fetch(http://www.google.com/intl/zh_CN/images/srpr/logo2w.png);

//创建一个文档。
var doc = DocumentApp.openById();

//将图像追加到第一段。
doc.getChild(0).asParagraph()。appendInlineImage(resp);
}

这个链接也可以帮助你:

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



快乐编码!


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 a Google script that can be inserted into a form to upload a file using Google forms but could not find anything. Is it doable and how, and even if there can be other ideas to do such thing please let me know.

解决方案

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 !

这篇关于将图片上传到Google电子表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆