ebidel / idb.filesystem.js

HTML5 Filesystem API polyfill using IndexedDB
https://www.npmjs.com/package/idb.filesystem.js
Other
488 stars 46 forks source link

IndexedDB w/ Blobs are not supported in Safari/iOS #30

Closed mudcube closed 8 years ago

mudcube commented 10 years ago

Although Safari/iOS supports IndexedDB they do not support Blob storage.

One solution is the following steps:

(a) Test for blob support in IndexedDB. The drawback here is this means requestFileSystem polyfill will not be available until support is detected, which may be after window.onload. (b) Convert from BlobToBase64 when FileWriter.write is executed (c) Convert from Base64ToBlob when a new FileEntry is created

Otherwise things are working nicely across browsers!

ebidel commented 10 years ago

I think coverting to/from base64 encoded "blobs" is the way to go. That makes it transparent to users of the library.

mudcube commented 9 years ago

When you get a chance could you take a look at my pull request which addresses this? https://github.com/ebidel/idb.filesystem.js/pull/31