GoogleChromeLabs / browser-fs-access

File System Access API with legacy fallback in the browser
https://googlechromelabs.github.io/browser-fs-access/demo/
Apache License 2.0
1.38k stars 84 forks source link

nativefs fileSave ignores options.mimeTypes #28

Closed bates64 closed 3 years ago

bates64 commented 3 years ago

fileSave (unlike fileOpen) with the new API doesn't implement options.mimeTypes: https://github.com/GoogleChromeLabs/browser-nativefs/blob/f7cb5883c87d179f705e93414c351e1d363641f0/src/nativefs/file-save.mjs#L31

On Chrome Windows (at least), this gives a discrepancy between opening (.bin and text/plain give what I would expect): image And saving using the file handle given by the above fileOpen (same options): image I opened a .bin file, so the MIME type application/octet-stream (I assume) was used and suddenly Windows is prompting me to save the file as a .exe too!