Sharing File: CloudDB

Hey Community!
I wanted to know that how can I upload a file to CloudDB (not talking about simple text/message)

Looking forward to a quick and helpful response.

Ishan

1 Like

FireBase and CloudDB are normally used to store short data.
If you want to save a file, use the KIO4_Base64 extension to convert it to String and then upload it with a tag.

Extension: Create Build Crear App Inventor Extensions Añadir librería externa Add lib Extension. @UsesLibraries. Pasar imagen a String y viceversa. Base 64.

1 Like

You can use the FirebaseStorage extension for that

Thanks! @Juan_Antonio and @Red_Panda
But unfortunately,
i am participating in google code 2 learn competition in which we are allowed to use only those extensions which are authentically of MIT APP INVENTOR 2

Please help!!

You should be able to directly upload binary files to cloudDB - it automatically converts them to base64 encoding to save them as a string, and decodes when you “download” them. This works for the MIT CloudDB (use only for testing and development purposes), and of course only test with small files.

2 Likes

Hey @TIMAI2,
Thanks!
But I don’t know how to do that.
It would be great and helpful if you could share blocks. :slightly_smiling_face:

http://ai2.appinventor.mit.edu/reference/components/storage.html#CloudDB

1 Like

@TIMAI2 Hi!
I know how to use it
But i dont know how to upload a binary file

If I remember correctly it is just the same as a value, use a text block with a path to the file name.

1 Like

Thanks!
but what if user wants to select the file which has to be uploaded?

if you want to upload files you must use firebase Storage extensions. You can get extensions here https://puravidaapps.com/extensions.php
Thank you. :grin: :+1:

...

Then write the code/blocks to enable them to do that :slight_smile:

1 Like

Nice one sir! i got it :grin:
by the way
thanks a lot
and yes,
marked your post

as solution as it helped me. :slightly_smiling_face:

Thanks a Lot!!

Thanks Ishan

2 Likes

No need to generate a new topic, I saw your earlier post. You need to be patient, contrary to popular belief, Power Users (inc. me) do have other things to do in life apart from helping solve AI2 issues on the forum! Moving this topic to the bottom of the previous one.

1 Like

You need to provide a full file path to the file in order to upload it to cloudDB.

For example, if you are developing with the companion app, and you have an image in your assets (media folder) called "myimage.png"then you would save the file like this:

1 Like

Apologies…Motive wasn’t to trouble you.
I am new to community therefore I thought that as the solution has been marked, the topic has closed therefore no reply was coming and hence, I created a new topic.

Would the image displayed in listviewer?
As i have used .appendvalue block instead of store value as i am creating this with the help of this tutorial with some modifications on my side like login register and attach file option
https://appinventor.mit.edu/explore/ai2/clouddb-chat

Thanks

The AI2 listviewer will not display images.

List the tags in the listviewer, then in the after picking event, set the value to an image component