<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>msi &#8211; 記下來</title>
	<atom:link href="https://noter.tw/tag/msi/feed/" rel="self" type="application/rss+xml" />
	<link>https://noter.tw</link>
	<description>一路上踩到的坑、遇到的問題，一點一滴記下來，希望能幫助到需要的人~</description>
	<lastBuildDate>Mon, 01 Jul 2019 09:09:01 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.6.3</generator>

<image>
	<url>https://noter.tw/wp-content/uploads/cropped-old-1130742_1920-1-32x32.jpg</url>
	<title>msi &#8211; 記下來</title>
	<link>https://noter.tw</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>tomcat 下載檔案卻直接亂碼開啟 at IE 10</title>
		<link>https://noter.tw/3055/tomcat-%e4%b8%8b%e8%bc%89%e6%aa%94%e6%a1%88%e5%8d%bb%e7%9b%b4%e6%8e%a5%e4%ba%82%e7%a2%bc%e9%96%8b%e5%95%9f-at-ie-10/</link>
					<comments>https://noter.tw/3055/tomcat-%e4%b8%8b%e8%bc%89%e6%aa%94%e6%a1%88%e5%8d%bb%e7%9b%b4%e6%8e%a5%e4%ba%82%e7%a2%bc%e9%96%8b%e5%95%9f-at-ie-10/#respond</comments>
		
		<dc:creator><![CDATA[黃小蛙]]></dc:creator>
		<pubDate>Mon, 02 Sep 2013 12:37:48 +0000</pubDate>
				<category><![CDATA[Web Server]]></category>
		<category><![CDATA[檔案格式錯誤]]></category>
		<category><![CDATA[亂碼]]></category>
		<category><![CDATA[tomcat]]></category>
		<category><![CDATA[web.xml]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[mime-mapping]]></category>
		<category><![CDATA[mime-type]]></category>
		<category><![CDATA[msi]]></category>
		<category><![CDATA[下載檔案]]></category>
		<category><![CDATA[副檔名]]></category>
		<guid isPermaLink="false">http://wazai.net/?p=3055</guid>

					<description><![CDATA[<p>上星期五接到一張 ticket 內容大概是網站上提供下載 .msi 的安裝檔案，在經過測試後大部分瀏覽器都可以正常下載檔案，唯獨漏掉測試的 IE 10 會出現問題，IE 10 會把 .msi 檔案當作&#46;&#46;&#46;</p>
<p>這篇文章 <a rel="nofollow" href="https://noter.tw/3055/tomcat-%e4%b8%8b%e8%bc%89%e6%aa%94%e6%a1%88%e5%8d%bb%e7%9b%b4%e6%8e%a5%e4%ba%82%e7%a2%bc%e9%96%8b%e5%95%9f-at-ie-10/" data-wpel-link="internal">tomcat 下載檔案卻直接亂碼開啟 at IE 10</a> 最早出現於 <a rel="nofollow" href="https://noter.tw" data-wpel-link="internal">記下來</a>。</p>
]]></description>
										<content:encoded><![CDATA[<p>上星期五接到一張 ticket 內容大概是網站上提供下載 .msi 的安裝檔案，在經過測試後大部分瀏覽器都可以正常下載檔案，唯獨漏掉測試的 IE 10 會出現問題，IE 10 會把 .msi 檔案當作文字檔一般開啟，在頁面上印出一堆亂碼，簡單記錄一下解決方法。<br />
<span id="more-3055"></span><br />
IE 一直以來都不怎麼令小蛙討喜，每次在 IE 不是跑版就是碰到一些奇奇怪怪的問題，相對的也可能習慣用 IE 的開發者來說會覺得 Chrome, Firefox 才是非正道，不管怎樣網站開發人員在相容性部份常常一個頭兩個大！小蛙這邊的系統是 tomcat 架設，在檔案下載 .msi 的部份，Chrome, Firefox 可以正常下載檔案，IE 8, IE 9 也都可以正常下載檔案，不知道為什麼到了 IE 10 就變成無法正常下載檔案了 &#8230;<br />
為了還原這張 ticket 的情況，特地將筆電中的 IE 9 更新到 IE 10，由於 Windows 7 的 IE 10 需要 SP 1 以上才可以安裝 &#8230; 又花了不少時間把 Windows 7 安裝 SP 1 再更新 IE 10，不知道為什麼每次遇到跟 IE 有關的問題都會滿肚子火(個人偏見)，前陣子看到朋友塗鴉牆上寫著「終於找到 IE 的用途了，是拿來下載 Chrome！」要不是有一些 IE only 的服務或是網站，小蛙心想 IE 被安裝在電腦上的比例會更低吧！<br />
離題了，這個問題是 IE 10 下載 tomcat 伺服器上的檔案時，會變成「直接開啟」的狀態，也就是跟下載 txt 檔相同，把 msi 檔案直接印在網頁上，本來小蛙懶得找原因，只想偷懶直接把 .msi 換成 .zip 檔案就可以下載了，後來想想有好幾個頁面要改，有點不甘心，決定還是 google 一下看看。<br />
可以透過簡單設定 tomcat 上的 /usr/local/tomcat/conf/web.xml&nbsp;設定檔來解決這個問題，路徑以 tomcat 安裝目錄為主，只要在 web.xml 中加入以下</p>
<pre class="brush: xml; gutter: true">&lt;mime-mapping&gt;
    &lt;extension&gt;msi&lt;/extension&gt;
    &lt;mime-type&gt;application/x-msi&lt;/mime-type&gt;
&lt;/mime-mapping&gt;</pre>
<p>重新啟動 tomcat 即可！打完收工！<br />
<strong>參考資料：</strong></p>
<ol>
<li>.msi downloading as text @ stackoverflow<br />
<address><a href="http://stackoverflow.com/questions/1079630/msi-downloading-as-text" target="_blank" rel="noopener noreferrer nofollow external" data-wpel-link="external" class="wpel-icon-right">http://stackoverflow.com/questions/1079630/msi-downloading-as-text<span class="wpel-icon wpel-image wpel-icon-6"></span></a></address>
</li>
</ol>
<p>這篇文章 <a rel="nofollow" href="https://noter.tw/3055/tomcat-%e4%b8%8b%e8%bc%89%e6%aa%94%e6%a1%88%e5%8d%bb%e7%9b%b4%e6%8e%a5%e4%ba%82%e7%a2%bc%e9%96%8b%e5%95%9f-at-ie-10/" data-wpel-link="internal">tomcat 下載檔案卻直接亂碼開啟 at IE 10</a> 最早出現於 <a rel="nofollow" href="https://noter.tw" data-wpel-link="internal">記下來</a>。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://noter.tw/3055/tomcat-%e4%b8%8b%e8%bc%89%e6%aa%94%e6%a1%88%e5%8d%bb%e7%9b%b4%e6%8e%a5%e4%ba%82%e7%a2%bc%e9%96%8b%e5%95%9f-at-ie-10/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
