Skip to content

Picviewer CE+: 批量 ZIP 下载文件名异常(MIME 类型包含斜杠导致被识别为文件夹) #1122

@gofreeing

Description

@gofreeing

Describe the bug
在使用图库的“批量 ZIP 下载”功能时,部分网站的文件名识别会出现严重错误。
原因在于这些网站服务器返回的 MIME 类型(Content-Type)是 application/octet-stream。脚本在 urlToBlob 逻辑中提取后缀时,直接把这个带斜杠 / 的字符串当成了扩展名。由于 ZIP 格式的文件名中,斜杠会被解压缩软件(如 Bandizip)识别为“文件夹分隔符”,导致下载后的压缩包里,每张图片都变成了一个名为 xxx.application 的文件夹,里面套着一个名为 octet-stream 的无后缀文件。

To Reproduce
Steps to reproduce the behavior:
访问图片托管在 pubg-img.si 等服务器的漫画网站。
按 G 键打开图库。
在图库设置中开启“使用 ZIP 下载”。
点击“下载图片”进行批量下载。
下载完成后使用解压软件查看,发现文件全部变成了文件夹。

Expected behavior
脚本应当能正确识别出图片真实的后缀(如从 URL 中提取 .webp),或者在处理后缀变量 ext 时过滤掉斜杠等非法字符,避免在压缩包内产生非预期的文件夹结构。

Screenshots
Image
Image

Desktop (please complete the following information):

  • OS: [win11]
  • Browser [chrome]
  • Version [Picviewer CE+ Version: 2026.1.23.1]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions