0

I'm working with MIT App Inventor 2 and Google Sheets to build an app that submits photos to a Drive folder as part of an error report form. I've got the photo upload bit working through a custom Apps script by Tim AI2 that looks like this:

function doPost(e) {
    var data = Utilities.base64Decode(e.parameters.data);
    var blob = Utilities.newBlob(data, e.parameters.mimetype, e.parameters.filename);
    DriveApp.getFolderById('<YOUR FOLDER ID HERE>').createFile(blob);
    return ContentService.createTextOutput("Your File Successfully Uploaded");
    }

JavaScript and I are...not friends, so I'm trying to wrap my head around grabbing the URL of the blob after it's generated and returning that instead of the status. Help?

  • Check documentation. What's the return value of `createFile()` method? – TheMaster Mar 31 '20 at 19:33
  • 1
    Returns File. Looks like there's a getDownloadURL method attached, too. Testing... – Melissa H Mar 31 '20 at 19:42
  • 1
    Were you able to solve your issue with the hint @TheMaster gave you? – alberto vielma Apr 01 '20 at 07:13
  • what about asking in the MIT App Inventor community? There you also will find TImAI2...https://community.appinventor.mit.edu/ – Taifun Apr 02 '20 at 03:22
  • It looks like the extension I'm using to encode and decode the images to string has a hardcoded response when I successfully upload something. I'm still looking at workarounds for that, since I don't want to reverse-engineer the extension itself. Job has ramped up the projects so this one had to take the back burner for now, which is why no response. Thanks for the tips, though - y'all put me on the right track at least! – Melissa H Apr 02 '20 at 11:51

0 Answers0