I want select a photo and send to google drive.why the companion send photo but phone dont send?

Hi thanks .no .dont work.

this too dont work with phone but work with ai2 companion.what is different between ai2 companion and phone?

There are some errors in your blocks, see my edited post above...

Do you mean when you have compiled the app ?

yes .when compile as ???.apk dont work.

:fu: apk adress

I have just edited you aia project, compiled and tested, works OK for me

pasokhnameh_revised.aia (49.2 KB)

above pasokhname.apk work ?

work with companion

dont work with phone

dont work for me

You apk is not putting anything in Label13, therefore the upload will not run

i change Save base64 to variable(path)instead of label 13. .AIA and APK are same.

I compiled your aia project

Blocks

and it worked and uploaded a file OK (Tested on Android 10 and Android 11 devices)

I am confused. thanks. I have to be more careful to find fault with my work. Thank you :rose:

my phone android is 8.


ai2 companion :fu:

Yes, it crashes on my 8.1 test device. OK,we are getting somewhere.....hang on


:fu: in my phone

Hi thanks. :rose: ok apk work with android 11 phone :laughing:

1 Like

Got this working companion and compiled on 8.1

mah.aia (49.1 KB)

Dragged in a File component and added a conditional permission request. Changed the base64 encode blocks.

ok work.thanks. :rose: :rose: :rose:
image

2 Likes

Hi . I want to specify the folder ID in the application, not in the app script

function doPost(e){
var data = Utilities. base64Decode(e.parameters.data);
var blob = Utilities. newBlob(data, e.parameters.mimetype, e.parameters.filename);
DriveApp.getFolderById('1cN6hP-JCa7UB13kZ67eA').createFile(blob);
return ContentService.createTextOutput("your File Successfully Uploaded");
}

What changes should I make in the app script?
thanks

Change this line:

DriveApp.getFolderById('1cN6hP-JCa7UB13kZ67eA').createFile(blob);

to

DriveApp.getFolderById(e.parameters.folderId).createFile(blob);

and add:
image

to your PostText

remember to create a new version of your script

1 Like

ok. thats right. thanks :rose:

1 Like

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