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.37k stars 82 forks source link

No support for MIME charset? #148

Closed Hawxy closed 9 months ago

Hawxy commented 9 months ago

Is this an issue with the underlying spec? Trying to a save a blob of type: 'text/csv;charset=UTF-8' results in Failed to execute 'showSaveFilePicker' on 'Window': Invalid type: text/csv;charset=utf-8.

tomayac commented 9 months ago

First, I doubt that the file pickers in operating systems will meaningfully allow you to filter by MIME type parameters like the charset, but that being said, the spec states explicitly that…

If parsedType’s parameters are not empty, then throw a TypeError.

…so that's working as per the spec algorithm. You need to remove MIME type parameters from your code.