0

I'm getting into some more advanced python stuff and I decided to take on a personal project that involved using a SQLite database. I want to store an image as a BLOB in the SQLite database but any method I've seen creates an image in the root folder and then converts that into binary to put into the BLOB in the SQLite database. The same thing happens when you want to view the image again. The binary is pulled from the database and an image is saved locally to be viewed.

I was wondering if there was a way to strictly view the image without having to save a copy of the image locally.

I know I could immediately delete the file right after the data is uploaded and downloaded from the database but that seems like too many steps. I can also include an option to create a local file if there was ever a need to use one, but the fact of storing an image both locally and in a SQLite database seems wasteful and redundant.

2
  • 1
    Maybe this other SO answer could help: stackoverflow.com/a/66517937/42346 Commented Sep 23, 2021 at 13:59
  • Thanks to both of you. This looks like a good place to start. Something I hadn't seen while searching through here. Commented Sep 24, 2021 at 12:19

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.