File Save As

I'm currently working on an Application that requires to save and open
files from a users computer with a selection dialog.

Opening files works fine by creating an <input type="file"> upon user
interaction, listening to the change event, triggering a click and
grabbing the file.

Saving files does not work as smooth:

- The a@download attribute lets me define a downloadable file which I
can offer from a BlobURL but there are three problems with it: #1 This
is a two-step UX where first the content has to be produced and then
the dialog can be shown, it's somewhat counter intuitive. #2 Left
clicking the link auto-saves to the downloads folder with the selected
file name (no way to choose a location). #3 Right click Save As is
even a bit more counter intuitive and the filename for the blob url
content is not derived from the a@download attribute.
- There is no way to trigger a native "Save As" dialog
- There is no way to reproduce the classical "Save" functionality
where the first save will let you choose a location but subsequent
saves overwrite that file.


Neither the File API nor the FileSaver API (somewhat counter
intuitively) define any behavior partaining to "Save As" or "Save". As
far as I can tell there is no standard for this. So far the workaround
seems to be to include a flash file and trigger the save-as via the
flash bridge, which I'm sure can't be the ideal situation for the
webapps WG.

Any suggestions how to alleviate this miserable state of affairs?

Received on Saturday, 5 January 2013 13:36:05 UTC