How to export an image from TinyDB

(I dont speak english but i’ll do my best)

Hi everyone…

I made a form using many data, for example.

1.- Number of Reg
2.- Name
3.- Adress
4.- Genre
5.- Age

etc, etc… at the end i take a picture and it will add to the DB.

Then i export all data in a CSV File but i dont know how export the images associated with every reg.

Can someone help me?

Thank u so much :slight_smile:

You can not add an image like a jpg or png to a TinyDB. A TinyDB is for text use only Reinaldo.

You can provide a link to an image stored in your Media or somewhere else.

You can also store the image as a Base64 image (see Save Base64 of Image Files in TinyDB using extension - Juan Antonio )

1 Like

thank u so much for anwering…
When i save every register, and then i want view for example the entry number 5… i can see the picture that i took when i saved that entry.

So i imagine the picture is saved in my DB

no, it is saved on your device…
you might want to use Do it to find out its path
see also tip 4 here https://puravidaapps.com/learn.php

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.

1 Like

i try to find that picture in my device and i cant find it… but when i load the listview, i can view the pictures that i’ve recorded in every Reg.

So, i understand i have to load the tinydb, decode every picture to Base64, and then save the picture as .jpg ?

what about providing a screenshot of your relevant blocks including Do it result of an example path?
Taifun

1 Like

Sure… thank u for helping… Please tell me if u dont understand something, really i dont speak english and i try to do my best.

Ok… The app im trying to make is fill a form with many data…
first, i put the number of registry, then a lot of data… including coordenates and taking a picture and save it in tinybd (or that i was thinking)

When i record many registries, then i can see a list with every registry i put into the tinybd…

I put a button “Exportar a CSV” and obviously i have a CSV but not the picture cause CSV is only text.
So my problem is export those pictures that i have recorded in every registry.

well, you provided screenshots of your design… this will not help anyone very much to find out, where your file has been stored…

what about

see again tip 4 here https://puravidaapps.com/learn.php about how to use Do it together with the companion app
Taifun

1 Like

Really i dont understand what can i do…
but i send the .aia of my project.CatastroMIT.aia (55.3 KB)

well, did you create any blocks in the blocks editor?
are you familiar with using Do it? Obviously not…
let me suggest to go back one step and do the tutorials to learn the basics…

A very good way to learn App Inventor is to read the free Inventor’s Manual here in the AI2 free online eBook http://www.appinventor.org/book2 … the links are at the bottom of the Web page. The book ‘teaches’ users how to program with AI2 blocks.
There is a free programming course here http://www.appinventor.org/content/CourseInABox/Intro and the aia files for the projects in the book are here: http://www.appinventor.org/bookFiles
How to do a lot of basic things with App Inventor are described here: http://www.appinventor.org/content/howDoYou/eventHandling .

Also do the tutorials http://appinventor.mit.edu/explore/ai2/tutorials.html to learn the basics of App Inventor, then try something and follow the Top 5 Tips: How to learn App Inventor

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.

1 Like

yes, i create many blocks in block editor, there is every part of the app i’ve created.

Just i dont understand when u say “Do it”… i guess its the explanation for each block i’ve put. But im not sure about that.

The app is working very well… my problem only is when i want to export the pictures that is in every registry in tinydb.

I can export to CSV all data i’ve stored in the tinydb, but i want to export the pictures too and that i can’t do it.

tip 4 explains how to use Do it …https://puravidaapps.com/learn.php

it is the debugging feature of App Inventor and one of the most important tools to use while building your app, see also Live Development, Testing, and Debugging Tools

Taifun

2 Likes

It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

To get an image of your blocks, right click in the Blocks Editor and select “Download Blocks as Image”. You might want to use an image editor to crop etc. if required. Then post it here in the community.

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.

1 Like

Here an example of TakePicture and Save picture and commentary in TinyDB.

1 Like

Here is the blocks for Save

Here is for View Listview of registries recorded

as already said, the pictures are stored in your device and the path to the pictures in TinyDB

can you elaborate on this… what exactly are you trying to do with those pictures stored in your device? what exactly means “export”? where to export to? upload to an online store like Google Drive? sending by email to someone? anything else?

Taifun