Image saving to / Reading from an SQlite database

Hello everyone !

I’d like to know how to insert an image to my SQLite table (i’m using Taifun SQLite extension).
I’ve read that I need to use the BLOB typeto save image to DB but I wonder how to convert my image to a such type :confused:
I also need to read the image from the DB.

Can someone give me some help please? :stuck_out_tongue:

EDIT: ok it seems that to do what I want, I have only 2 solutions :

  • use Cloudinary or Firebase online database to upload images (but need to be online)
  • store image on device and only save path to database (better solution for me because I want an offline app).

I am right ?

Yes you can do so,

If you are storing the file path in database rather you can store the file path in tinydb, so your app becomes offline

Hello @Soham_Shah :slight_smile:
As I will use an SQLite DB, I will store them into it :wink:

If you want a offline app then to set/get data from database it will need internet connection.

My .sqlite db is embeded on my device :neutral_face:

Why sould I be online to connect to a local database ?

You don’t need internet …

First good news of the day, thanks @Rogerio_Rios

Actually I don’t know about that :sweat_smile:

You should mark your first post as solution @stefun as you had only cleared your doubt in the first post

You can’t mark first post as solution :sweat_smile:

¿How do you store an image into SQLite? I need to resolve the same problem.

Did you try to save your image path in the bank?

Not yet, but I thougth we can save an image into SQLite as blob.

Did You searched ? What are you failing to do?

I´m searching and i´ve found it

But I don´t find the how to…

Hello @Proyecto_Freelance, if you find some stuff, please share. I’m still wondering hot to store image in SQLite ! :confused:

1 Like