Upload files to GDrive followed by a link of the uploaded file in Google sheet

@Anke

I have asked @Juan_Antonio about this, the // does not work :wink:

@Jean_Yves_Le_Magnifi

Re: Using camera for image

Try these blocks, they are working for me:

You may want to introduce an image resizing routine using Taifun's Image extension (or other method). camera images can be between 2 - 5 mb in size, these will take a long time to upload, and of course take up more space/storage on your google drive account. If you need the full size, then perhaps introduce a progress dialog to show that something is happening....

Ok, but this shouldn't work for the compiled app (APK).

You are right. This ?

image

Otherwise file extension required to get pathToAssets and copy file to ASD.....

[edit - to be honest, I was focusing on the proof for the google apps script web app, more than the blocks]

@TIMAI2, apologize for the lateness of response, first of all, thank you very much I tested with multiples tags alongside and it works perfectly. (i thought about the Taifun extension for the Pictures size).
Last but not least I tried with multiple pictures and my issue is that when uploading the picture, the last one appeared every time (by the way I'm not trying to upload all at the same time).

every image has its own button which calls the same blocks to upload

display of the app:

Here are my blocks:
(i tried to set the image to global but I got errors)

thanks in advance :slight_smile:

Possibly here:

image

Your filename needs to be for the image related to the button. Set a variable for image in the sendPic procedure, and set this in the button longClick event - imagePicture...

@TIMAI2, the created variable still uploads the same picture. And when added to the button, I got error.

quite stuck here :frowning:

Something like this:

image

you may have to edit the image.Picture path

@TIMAI2, ok but that about the camImage variables present in the kio4 base .GotString and .AfterPicture

Advise applied but i still get errors while sending

its the last straight line and its the dot of the app :frowning:

@TIMAI2, for the info I got this error while sending

thanks in advance :slight_smile:

You are not sending a correctly encoded base64 string. Use Do It to check your encoded string, and trace the issue, most probably an incorrect path to the file.

@TIMAI2, if you don't mind, can you please have a look at my aia. I can't see the issue. :slight_smile:

test2.aia (48.3 KB)

These should be draggable blocks, you can just drag an drop onto your blocks editor.

Add this block

Change sendPic procedure to this block

These return a base64 string from the image.Picture selected

I had trouble using the longClick button, components jumping about on screen when button pressed, this might be causing a problem.

@TIMAI2 it works fine. thank you for having the time to help with tackling issues and sharing your knowledge with others.
Sincere thanks

Pleased you got there in the end :slight_smile:

@TIMAI2, for info I got an issue with android 6 on my tablet, saying that is a bad arguments to > the operation >cannot accept the arguments:,["6.0.1"],[9]

Don't you just love Android version numbering.

I believe Android 6.0.1 was an exception to the rule. You will need to capture this and use a condition other than less than/greater than 9.

Something like this: (draggable)

[ edit: image removed because better solution below]

Actually, better,... test for the API number using a block from the base64 extension

( I spotted a 4.0.3 and 4.4W android version as well, oddly no 6.0.1 in the list I found)

Hello @TIMAI2, sincere apologies for the lateness. I modified the blocks and the picture are uploaded like a charm.

1 question: can I still use the modified block as it is or should I make more modifications? as the blocks are for testing the API

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