DDJ
DDJ

Reputation: 855

How can you store a file, like pdf, in a offline sqlite database?

I can use the window.openDatabase to put in SQL values of text, but is there a simple way to put in a file?

Upvotes: 0

Views: 49

Answers (1)

Sami Kuhmonen
Sami Kuhmonen

Reputation: 31173

While SQLite would support binary blobs just fine, the practically dead Web SQL proposal only supports text. You would need to encode the data to text, maybe with Base64, before storing it.

Also note that not all implementations might give you enough storage.

Upvotes: 1

Related Questions