Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用 python ZipFile 创建 zip 存档时,如何设置文件 mime 类型?
ZIP 格式不携带存档中包含的单个文件的 MIME 内容类型,尽管 ZIP 格式本身具有 MIME 内容类型:application\zip.
application\zip
您必须为 ZIP 存档中包含的文件确定适当的 MIME 内容类型的唯一方法是检查文件名并使用其文件扩展名来确定可能的 MIME 内容类型。
这个问题没有任何意义。文件与文件大小(和标志 afaik)一起作为二进制内容存储在 ZIP 存档中。但是这里绝对不涉及 mimetype 信息。