Allow `createObjectURL` to retain filename from `File` (and similar) objects
还没有人认领这个 Issue。
评估
调研方向
首先阅读 File API 规范中围绕 createObjectURL 入口点的内容,以及 File、Blob 和 object URLs 的定义。确定拟议的文件名应如何与保存行为交互,然后更新规范以定义这一偏好;如果规范指出了相关的测试位置,则添加或调整一致性测试覆盖。
由索引模型根据 Issue 内容生成。
描述
What problem are you trying to solve?
We have a datastore that requires authentication to retrieve files (e.g. PDF, CSV, ZIP, PNG, or some Office suite file format) -- it has a file name, a content type, and data. We'd like to allow users to click a link (or button/...) and have the "file" corresponding to that data (which we currently retrieve in a Blob) open in their browser (or download depending on how the browser is feeling) and if at some point the browser decides to save the file (e.g. because the user asks to save a file, or because it doesn't have an internal handler) then we'd like it to favor our proposed filename instead of a blob id.
What solutions exist today?
- We can construct a
Blobor aFilew/ aBloband callcreateObjectURLwith it. - We can create an anchor
awitha#downloadwith the href set the the url fromcreateObjectURLsuch that users can click the anchor to get our suggested filename. - We can add an iframe containing our blob url
Fwiw, Microsoft had an msSaveBlob which included a defaultName field...
How would you solve it?
Change the specification for createObjectURL so that for objects that have a name (e.g. File), browsers should prefer that name over the blob when saving.
- 主要语言
- HTML
- 星标
- 118
- 派生
- 52
- 平均合并
- 9 天 16 小时
- 30 天内合并 PR
- 1
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
w3c/FileAPI 的其他 Issue
-
TPAC2026
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 1/5 1 小时以内 新手友好度 62/100
-
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 5/5 一周以上 新手友好度 30/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 65/100
openfoodfacts/score-my-recipe#80 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
snapshot-labs/stamp#702 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 86/100
-
Cainophile EXIT handler crashes on its own password redaction and logs the DB password in clear text未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
digitallyinduced/ihp#2832 ·
维护者通常 1 天内回复