Solve download RAR file but shows content

user-pic
Vote 0 Votes

若下載 RAR 檔案卻在網頁上直接出現檔案內容 (Rar!一推亂碼)
原因是 Web Server 送出的 Content-Type: 是 text/plain;
若是用 Apache, 在 httpd.conf 找出 TypesConfig 是指向的 mime.types 路徑,
編輯 mime.types, 加入 application/x-rar-compressed rar
或者去抓最新 Apache 裡面的 mime.types 覆蓋
然後重啟 Apache
curl -I http://yourhost/file.rar
有出現 Content-Type: application/x-rar-compressed 表示正常

Leave a comment

About this Entry

This page contains a single entry by Pank published on June 1, 2010 6:00 PM.

Image Resizer Powertoy Clone for Windows 7/Vista was the previous entry in this blog.

IPSec LAN to LAN VPN is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Monthly Archives