It should indeed work to use .NET File I/O to write to IndexedDB - not even intentionally on our side, but simply because IL2CPP implements .NET File I/O on top of posix file functions, and emscripten implements those on top of IndexedDB. However, because posix file io is synchronous (you can call fread and have it block until you get a result), and IndexedDB is not, emscripten will cache file I/O locally in memory. You may need to call
FS.syncfs(false, function (err) {
});
To flush cached file writes to IndexedDB. Let us know if it works.
I want to bump this thread to confirm what Jonas mentioned, calling FS.syncfs in javascript is necessary for persistent storage to survive between different launches of the app. You’ll need to stick that code into a javascript (browser javascript) and call it via Application.ExternalCall after you finish writing to your file. It does work however, and works quite well!