Upload image from your Computer to Google Drive using HTML-form. Show image via URL (IMAGE function) in your Spreadsheet
The sctipt was originally designed by Kanshi TANAIKE.
Please see the original script and instructions first.
function test_xmlToJson(xmlString) { | |
var xmltext = '<ALEXA VER="0.9" URL="davidwalsh.name/" HOME="0" AID="="><SD TITLE="A" FLAGS="" HOST="davidwalsh.name"><TITLE TEXT="David Walsh Blog :: PHP, MySQL, CSS, Javascript, MooTools, and Everything Else"/><LINKSIN NUM="1102"/><SPEED TEXT="1421" PCT="51"/></SD><SD><POPULARITY URL="davidwalsh.name/" TEXT="7131"/><REACH RANK="5952"/><RANK DELTA="-1648"/></SD></ALEXA>'; | |
var xml = XmlService.parse(xmltext); | |
Logger.log(JSON.stringify(xmlToJson_(xml))); | |
// returns this: | |
//{ | |
// "ALEXA":{ | |
// "@attributes":{ | |
// "VER":"0.9", | |
// "URL":"davidwalsh.name/", |
The sctipt was originally designed by Kanshi TANAIKE.
Please see the original script and instructions first.
This is a sample script for uploading local file to Google Drive without the authorization using HTML form. A selected file in your local PC using HTML form is uploaded to Google Drive and saved to Google Drive.
When you use this, at first, please deploy Web Apps. The script is doPost()
of following scripts.
function doPost(e) {
var data = Utilities.base64Decode(e.parameters.data);
/* | |
* Licensed to the Apache Software Foundation (ASF) under one | |
* or more contributor license agreements. See the NOTICE file | |
* distributed with this work for additional information | |
* regarding copyright ownership. The ASF licenses this file | |
* to you under the Apache License, Version 2.0 (the | |
* "License"); you may not use this file except in compliance | |
* with the License. You may obtain a copy of the License at | |
* |
function exportSpreadsheet() { | |
//All requests must include id in the path and a format parameter | |
//https://docs.google.com/spreadsheets/d/{SpreadsheetId}/export | |
//FORMATS WITH NO ADDITIONAL OPTIONS | |
//format=xlsx //excel | |
//format=ods //Open Document Spreadsheet | |
//format=zip //html zipped | |
height: 800 | |
scrolling: no | |
border: no |
// sample files are here: https://drive.google.com/drive/folders/1U4GrMHHyakOoCG3PVehkQD_AKADvFdVL | |
var C_FILE_TRIGGER_ID = ''; // Put your file id here if you plan to use it as Library | |
var C_SHEET_EVAL = '_Ini_'; | |
var C_RANGE_VALS = 'C2:D'; | |
var CCC_ = {}; // for holding constants | |
var C_DELIMETER1_NAME = 'STR_DELIMEER1'; | |
// get settings from named range | |
function getSettings_(getAgain) |
=ArrayFormula( | |
VLOOKUP( | |
CEILING(ROW(OFFSET(INDIRECT("A1"),,,COUNTA(A2:A)*COUNTA(B2:B)))/COUNTA(B2:B)) , | |
{ROW(A2:A)-row(A1),A2:A} , 2, ) | |
) |
var C_COLS_LEAVE = 1; | |
var C_ROWS_LEAVE = 25; | |
function deleteEmptyCells() { | |
var file = SpreadsheetApp.getActive(); | |
var sheets = file.getSheets(); | |
for (var i = 0, l = sheets.length; i < l; i++) { deleteEmptyCellsSheet_(sheets[i]); } | |
return 0; | |
// SETTINGS | |
var C_VALS = ['ABC' , 'DEF' , 'GHI' , 'JKL' , 'MNO' , 'PQR' , 'STU' , 'VWX' , 'YZA']; | |
var C_SHEETS = ['Sheet1']; | |
var C_COLUMN = 'H'; | |
function test_deleteSheetRowsWithSettings() | |
{ | |
var values = C_VALS; | |
var sheets = C_SHEETS; |