<p style="text-align: left;">根据CANIUSE(http://caniuse.com/#search=download)download兼容性如下图所示:</p> <p style="text-align: left;"><img src="https://img.php.cn/upload/article/000/000/013/dee97ade7b856f0525bd3fa3cb719994-0.png" alt="download下载文件IE兼容性处理的方法介绍" style="max-width:90%" style="max-width:90%" title="download下载文件IE兼容性处理的方法介绍"></p> <p style="text-align: left;">如上图所示,<a href="//m.sbmmt.com/browsers/browsers-explorer.html" target="_blank">IE浏览器</a>是不支持的。</p> <h1 style="text-align: left;"> 1、测试代码:</h1> <div class="code" style="position:relative; padding:0px; margin:0px;"><pre><!doctype html> <html> <head> <meta charset="UTF-8" /> <title>download 下载文件 IE兼容性处理</title> </head> <body> <a href="123.docx" download="123.docx">下载</a> </body> </html></pre><div class="contentsignin">登录后复制</div></div> <h1 style="text-align: left;">2、效果:</h1> <p style="text-align: left;"><img src="https://img.php.cn/upload/article/000/000/013/dee97ade7b856f0525bd3fa3cb719994-1.png" alt="download下载文件IE兼容性处理的方法介绍" style="max-width:90%" style="max-width:90%" title="download下载文件IE兼容性处理的方法介绍"></p> <p style="text-align: left;"> 并且下载的压缩包文件中没有123.docx。</p> <h1 style="text-align: left;">3、兼容性处理</h1> <h1 style="text-align: left;">将文件123.docx(其他文件一样处理)压缩为123.zip文件后,再进行下载。</h1> <p style="text-align: left;">示例代码:</p> <div class="code" style="position:relative; padding:0px; margin:0px;"><pre><!doctype html> <html> <head> <meta charset="UTF-8" /> <title>download 下载文件 IE兼容性处理</title> </head> <body> <a href="123.zip" download="123.zip">下载</a> </body> </html></pre><div class="contentsignin">登录后复制</div></div> <h1 style="text-align: left;">总结:</h1> <p style="text-align: left;">将文件压缩为zip、rar扩展名后再进行下载。</p>