IndexedDB: Store file as File or Blob or ArrayBuffer. What is the best option?
问题 Now most of browsers are supporting IndexedDB to store data/file directly as File , Blob or ArrayBuffer . This code saves a IDB key 'File1' as File <input type="file" id="userfile" /> var a = document.getElementById("userfile"); var b = a.files[0]; Now we can directly save this file to IDB using the following code //LocalForage is a library for indexedDB developed by Mozilla //Note: localforage._config.driver=asyncStorage (IDB method) function run(){ //"File1" = IDB data table key and b=value