Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I think the spec you're looking for is the FileSystem API (https://developer.mozilla.org/en-US/docs/Web/API/File_and_Di...), not the File API.

Unfortunately, this is a non-standard API implemented only by Chrome. You have to use other APIs like IndexedDB and WebSQL (also deprecated and non-standard) to get a working solution in all browsers.

This deficiency is really holding back the web.



Yup, this works - https://github.com/erbbysam/webRTCCopy/blob/master/client/js... (not the cleanest code)

You can then use idb.filesystem.js to add api support for firefox etc. Search the file above for "is_chrome" for a few idb.filesystem.js-specific quirks.

Looking at that page, it looks like firefox will ship with support in version 50?


I'm using idb.filesystem.js in https://www.sharedrop.io, so that only very small part of the transferred file is stored in memory, but then without asking users for permission (i.e. using non-persistent storage) you "only" get ~4GB (not sure exactly, I tested it with files up to 1.5GB).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: