I was searching for many ways to save the image in TinyDB, so that we can show image later in our app. Well, it is not possible to save the image in TinyDB as TinyDB only saves strings and integers but I found a way which will work for you.
We use images in two ways in our app:
i) Image from assets.
ii) Image from internal storage which is available in our mobile.
While image from assets are easy to save in tiny db, as we can just store name of file loaded in the asset. See the blocks below:
Now, when we select image from our device, we can get the image path using ‘Image_Picker’ component and then we can store the path value in TinyDB. See the blocks below:
In that way, text can be saved only, and will only get the path of the asset image. If you have to use the external storage, you must first ask permission.
Glad it helped you. I would like to give you a suggestion.
If you want to show the downloaded image in your app, don’t save the path in the TinyDB because your app will take more space in the device. You should Taifun Files Extension to show the downloaded images.