I'm developing a web application that can be used offline. Among other features it should be able to save a binary file with user created data to the device. In particular, on iPad it should allow to download the file and get an "Open In..." dialog, e.g. to save the file to Dropbox. Possible browsers are Safari and Chrome (on iPad). How to do that from JavaScript?
This question - Using HTML5/Javascript to generate and save a file - provides a number of recipes. I've tried this - https://stackoverflow.com/a/19230609/404099 - and it allowed to open a text file in another tab. Alas - no way to save to Dropbox and didn't work with a binary file.
The https://github.com/eligrey/FileSaver.js library works the same. Text files are opened in another tab, binary files doesn't work. E.g.:
var blob = new Blob(["Hello, world!"], {type: "application/octet-stream"});
saveAs(blob, "hello-world.dat");