How can I save binary data (in an ArrayBuffer object) into IndexedDB?
The IndexedDB spec doesn't mention ArrayBuffer - does that mean that is not supported (and I have to pack ArrayBuffer as a string or a an array?).
Simply saving the ArrayBuffer should "just work". I believe it does in all current IndexedDB implementations.
I.e. something like:
var trans = db.transaction("mystore", IDBTransaction.READ_WRITE); // or "readwrite"
trans.objectStore("mystore").put(myArrayBuffer, "mykey");
Finding that this is defined by specifications is... challenging... to say the least. But it goes something like this:
Yeah, I know, I wouldn't have found it either.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With