简体   繁体   English

PHP形式的mime类型差异

[英]Difference in mime-type in form PHP

I would like upload .docx, but 我想上传.docx,但是

In $_FILES['field']['type'] is application/vnd.openxmlformats-officedocument.wordprocessingml.document , but in mime_content_type() return application/zip $_FILES['field']['type']application/vnd.openxmlformats-officedocument.wordprocessingml.document ,但在mime_content_type()返回application/zip

Why these types are diffrent? 为什么这些类型不同? Which is good? 哪个好

The DOCX format consists of a number of different files all wrapped up in a zip file. DOCX格式由许多不同的文件组成,所有文件都打包在一个zip文件中。 The software you are using is examining the file, seeing it is a zip file and reporting it with the standard MIME type for zip. 您使用的软件正在检查该文件,发现它是一个zip文件,并使用zip的标准MIME类型对其进行报告。

"Good" is somewhat subjecting, but application/vnd.openxmlformats-officedocument.wordprocessingml.document is probably better as it is more specific. “良好”在某种程度上受到application/vnd.openxmlformats-officedocument.wordprocessingml.document ,但是application/vnd.openxmlformats-officedocument.wordprocessingml.document可能更好,因为它更具体。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM