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

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

问题描述

我正在举办一个摄影比赛,参赛者应该使用谷歌注册表进行注册,并上传他的照片.我在整个互联网上搜索以找到一个 Google 脚本,该脚本可以插入到表单中以使用 Google 表单上传文件,但找不到任何内容.是否可行以及如何做,即使还有其他想法可以做这样的事情,请告诉我.

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.

推荐答案

试试这个

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

快乐编码!

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

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