日期:2014-05-16  浏览次数:20597 次

apache怎样让.gz格式文件点击直接下载?而不是在浏览器里打开乱码
这个要怎么设置?

貌似我的一台centos系统正常,但是debian系统打开带gz格式的文件全直接在浏览器里显示乱码,我是想让它点击.gz文件直接下载

要在apache里设置?

可是我看了centos和debian的apache配置文件里面关于.gz的配置都一样,没什么区别,如下:

Assembly code
<IfModule mime_module>
    TypesConfig conf/mime.types
    AddType application/x-gzip .tgz
    AddEncoding x-compress .Z
    AddEncoding x-gzip .gz .tgz
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
    AddHandler cgi-script .cgi
    AddHandler type-map var
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
    AddType video/x-ms-asf .avi
    AddType video/mpeg .mpg
    AddType video/mpeg .mpeg
    AddType video/quicktime .mov
    AddType video/x-ms-wmv .wmv
</IfModule>



------解决方案--------------------
这是浏览器行为吧
------解决方案--------------------
如果是firefox, 在编辑--首选项--应用程序中, 可以设置.

其他也是要设置浏览器.