-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
suggest a default filename when saving #80
Comments
Agreed that this does seem useful. Note that you can specify |
This is the only missing feature that even the download attribute is ahead of ;) |
The open file dialog seems to select the first format passed to
Manually reordering the array would not be very helpful, as this would also change the sorting of the formats in the file open dialog. |
Also, it would be interesting to know which format the user has chosen. What’s the plan here?
Maybe this could be informally added to the spec. |
Not related to the spec, but I think i found a (mac?) bug... tested out the new showSaveFilePicker({
excludeAcceptAllOption: true,
types: [{
accept: {
'image/jpg': [ "jpg" ]
}
}]
}) the filename it suggest was other extensions like |
@jimmywarting that sounds like https://bugs.chromium.org/p/chromium/issues/detail?id=1103133, which should be fixed now (the suggested extension should now be the first script specified extension). |
This may be a different issue but I'd like a way to supply the extension or, ideally, a suggested file name. This is for MicroBlocks (https://microblocks.fun), a blocks programming IDE for the micro:bit and similar boards. We use the extensions .ubp and .ubl for MicroBlocks projects and libraries and the extensions .hex and .uf2 for compiled binaries. By using "types: [{ accept: ..." in the options object I'm able to get Chrome 86 to fill in .upb and .hex but not the other two extensions. The .uf2 extensions is changed to .bin and the .ubl extension is changed to .text. Is there any way to force Chrome to use a specific extension? |
This issue is one of the few blockers (example) for getting rid of the legacy |
Please support custom file name, which is very important for smooth migration from a download! Because of the lack of this feature, I was very confused and distressed when migrating to the File System Access API for Chrome DevTools. |
#261 has a proposal for an API for this, feedback welcome. |
…#261) * Add initial explainer for suggestedName, startIn and related options. This describes a proposal for #85, #144, #94 amd #80. Co-authored-by: a-sully <[email protected]> Co-authored-by: Thomas Steiner <[email protected]>
…related options. (#261) * Add initial explainer for suggestedName, startIn and related options. This describes a proposal for #85, #144, #94 amd #80. Co-authored-by: a-sully <[email protected]> Co-authored-by: Thomas Steiner <[email protected]> SHA: 282dcba Reason: push, by @mkruisselbrink Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This adds the options as described in https://github.com/WICG/file-system-access/blob/main/SuggestedNameAndDir.md. Fixes #85, fixes #144, fixes #94 and fixes #80 Co-authored-by: Austin Sullivan <[email protected]>
…er methods. (#287) This adds the options as described in https://github.com/WICG/file-system-access/blob/main/SuggestedNameAndDir.md. Fixes #85, fixes #144, fixes #94 and fixes #80 Co-authored-by: Austin Sullivan <[email protected]> SHA: 3309115 Reason: push, by @mkruisselbrink Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
I didn't find anything about saving a file with a suggested filename in the spec
You should be able to suggest a filename when you want the user to save something
chooseFileSystemEntries({ type:'saveFile', name: 'documents.zip' })
the unknown filename is pretty bad if you don't know the extension and you won't be able to open it.
hence why i think
saveFile
is pretty bad and why i would only useopenDirectory
with write permission instead so i can specify the filename myself, but i don't want to enforce a filename or have write permission to a hole folder, users may not want to allow it.The text was updated successfully, but these errors were encountered: