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.
我正在使用此标头 Content-type: application/vnd.ms-word;,但在 firefox 下没有使用它,它正在下载文件但没有扩展名。为什么,这是firefox的一些安全措施吗?
Firefox 不会自行将 .doc 添加到下载的文件中,即使 mime 类型表明它是 word doc。它将使用Content-disposition标题指定的文件名:
Content-disposition
header('Content-type: application/vnd.ms-word'); header('Content-disposition: attachment; filename="yourfile.doc"');