Save images to SQLite

Please, help me. How can i save javascript BLOB object to SQLite BLOB.

I have BLOB object:

size: 96874
type: "image/jpeg"
proto: Blob
length: 1

What shall i do with that object to save it in SQLite. And how can i get that object from SQLite and upload it on server?


It’s better that you don’t use databases to store images, maybe you can use file or image cache. What do you need to do?

If the images weren’t that big you could try base64 encoding them and then putting them in the database as TEXT. I’d do some caching of the base64 decoded images otherwise the retrieve / decode performance could be horrible.

But as fabioferrero says I would tend to store as files and then perhaps in the database just store the filesystem path to the image file.