ZIP imports fail on uncommon filetypes
还没有人认领这个 Issue。
评估
调研方向
首先跟踪 ZIP 导入路径,以及 manifest.json 和 Python 的 mimetypes 库如何确定 ContentType。将其与浏览器上传路径进行比较,重点关注 .webp 和 .avif 等不常见类型。完成标准是:ZIP 导入能够处理已接受的文件而不会出现报告中的验证错误,并且为受影响的文件类型提供覆盖。
由索引模型根据 Issue 内容生成。
描述
In Zendesk 9788, a user reported this error being displayed when they tried to import a ZIP created using the export function originally discussed in #304
Parameter validation failed: Invalid type for parameter ContentType, value: None, type: , valid types:
It turns out that the python mimetypes library on our production system fails to guess the type of .webp and .avif files, among others. There's an asymmetry in that, when uploaded, the browser reports the mime type, so users of the editor can introduce these files without a hitch, but the import process doesn't know what the mimetype was.
The workaround, in this case, was to remove the problem files from the ZIP, import the rest of the archive, and then use the editor to re-upload the single .webp file which was actually being used (the rest were not used in the storymap)
A partial solution would be to configure mimetypes to understand more filetypes. .webp seems pretty natural. I was unfamiliar with .avif but CanIUse reports that most browsers except Edge support it. Still, this kind of kicks the can down the road without necessarily solving it.
Another option, which may not actually be possible, would be to write the mime types into the manifest.json included in the export ZIP, if we can recover them, perhaps from boto. Using this instead of "guessing" should ensure that any file we've accepted through the editor can also be accepted through the import.
See also #487 which suggests limiting which files are included in exports. In this case it would have filtered out most, but not all, of the uncommon filetypes.
- 主要语言
- JavaScript
- 星标
- 249
- 派生
- 61
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
NUKnightLab/StoryMapJS 的其他 Issue
-
难度 5/5 一周以上 新手友好度 35/100
NUKnightLab/StoryMapJS#507 ·
-
Visual glitches未关闭
难度 4/5 3-5 天 新手友好度 48/100
NUKnightLab/StoryMapJS#506 ·
-
难度 5/5 一周以上 新手友好度 35/100
NUKnightLab/StoryMapJS#505 ·
-
难度 2/5 1-3 小时 新手友好度 50/100
NUKnightLab/StoryMapJS#495 ·
-
难度 4/5 3-5 天 新手友好度 45/100
NUKnightLab/StoryMapJS#487 ·
查看 NUKnightLab/StoryMapJS 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
openlibhums/janeway#5604 ·
维护者通常 1 天内回复
-
[BUG] Generic OSC does not initialize OSC client on startup when "Listen for Feedback" is disabled未关闭
难度 2/5 1-3 小时 新手友好度 86/100
-
area/statement-execution TS conversion
难度 2/5 1-3 小时 新手友好度 76/100
scylladb/nodejs-rs-driver#584 ·
维护者通常 2 天内回复
-
documentation good first issue help wanted
难度 1/5 1-3 小时 新手友好度 92/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 69/100
维护者通常 2 天内回复