//This section just for the example - to allow images to be replaced from trash var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[1]; sheet.appendRow([e.parameter.id]); //end of example section
Here is the code for the web app, which is a script bound to the spreadsheet
function doGet() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; var rngVal = sheet.getRange("A1").getValue(); var newVal = rngVal + 1; sheet.getRange("A1").setValue(newVal); return ContentService.createTextOutput(newVal);}
//for PC browserfunction doPost() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; var rngVal = sheet.getRange("A1").getValue(); var newVal = rngVal + 1; sheet.getRange("A1").setValue(newVal); return ContentService.createTextOutput(newVal);}
When you publish the script as a web app, you should run it as you, but ensure that anyone can access it. Every time you make a change to the web app you must publish a new version.
You can also run the web app in your browser using the web app url, it will return a white page with the latest number in the top left corner:
https://script.google.com/macros/s/AKfycbz9XZ1YU_yaSsiJNqbk41p58b5ZgQpbrQ_aBfGPlmG5x8UId6m3/exec
Here is the link for the spreadsheet, so you can see the sheet updating as you activate the web app:
https://docs.google.com/spreadsheets/d/1YbuuoptAWtj4O9eIzipUzSRj5uvauJAqx5SSxjWq60w/edit#gid=0
For your purposes, you should remove the code section from your script, then you do not need the second sheet, unless you want a record of the files deleted on the second sheet
function doGet(e) {return message("Error: no parameters in doGet"); }
function doPost(e) { if (!e.parameters.filename || !e.parameters.file || !e.parameters.imageformat) { return message("Error: Bad parameters in doPost"); } else { var imgf = e.parameters.imageformat[0].toUpperCase(); var mime =