Photo and uploading it to Google drive

Hi, I'm trying to create an app that includes selecting a photo and uploading it to Google drive, I found this forum: https://groups.google.com/forum/#!category-topic/mitappinventortest/general-questions-about-app -inventor-programming / FwIwVgvYhsM that complements this forum: https://groups.google.com/forum/#!topicsearchin/mitappinventortest/after$3Ayesterday/mitappinventortest/jW7cvVkfgCk and additionally this video https://www.youtube.com/ watch? v = qNl1u3ckKJk & t = 7s, however it did not work, I think it is a permission issue but I still cannot find the solution. Please help me to run it properly.

Try this:

HOWTO: Upload Image to Google Drive using base64 and Google Apps Script Web App

and remember this:

1 Open the script project
2 Go to Publish
3 Deploy as Web App
4 Project version: - select New from the dropdown
5 Execute the app as: your google account address (email)
6 Who has access to the app: Anyone, even anonymous
7 Press the Update button

You have to do this EVERY TIME you change your script

Also see here:

https://ai2.metricrat.co.uk/guides/upload-any-file-to-google-drive-with-ai2

1 Like

Thank you, I will review the information

Hello, it always generates the following error: "Something went wrong, or the file cannot be uploaded"

Please show your blocks and your script (as text please, not a screenshot)

function doPost(e) {

var data = Utilities.base64Decode(e.parameters.data);
var blob = Utilities.newBlob(data, e.parameters.mimetype, e.parameters.filename);
DriveApp.getFolderById('1iJ5nFxshfvdZMDE0Zt3Fcu37Ec_rvTG5').createFile(blob);
return ContentService.createTextOutput("Your File Successfully Uploaded");
}

Use right click on blank space in the blocks editor to Download an image of your blocks

Did you:

Remember to publish and create a new version each time you changed something in the script. The script should run as the owner of the google account, and be accessible to “anyone,even anonymous”

Do you have a file called ai2logo.png in your assets ?

el archivo esta incluido en la carpeta: \Phone\AppInventor\assets

What phone and android version do you have?

for app inventor I have a galaxy s5 active, Android Version 4.4.2

OK. Have tested at my end and all is working OK here ( I know that doesn't help directly, but it does demonstrate that the process works).

Please confirm that you have republished your app to a new version, and given permission to your app to access your google drive.

Okay, I still can't find the problem but I really appreciate your help.

image

Cualquiera, incluso snónimo

I do say this in the instructions on my website

image

From Google:

image

You are accessing the web app as anonymous, it doesn't know about you or any google account.

I made the change you told me and it finally worked, you don't know how much I thank you, I've been looking for the solution for a long time

Just to round this one off:

https://ai2.metricrat.co.uk/guides/howto-create-a-google-apps-script-web-app-bound-to-a-spreadsheet

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.