。Chromev文件的Google Chrome MIME类型?

时间:2018-04-10 18:00:40

标签: csv google-chrome nginx browser mime-types

Google Chrome是否支持csv MIME类型?我的mime.types(Nginx)文件中有以下条目(这些只是csv相关条目):

types {
  text/csv                              csv;
  text/comma-separated-values           csv;
  text/anytext                          csv;
  application/csv                       csv;
  application/csv+xml                   csv;

}

这是我的nginx.conf文件:

    user  nginx;
    worker_processes  1;

    error_log  /var/log/nginx/error.log warn;
    pid        /var/run/nginx.pid;


    events {
      worker_connections  1024;
    }


    http {
      include       /etc/nginx/mime.types;
      default_type  application/octet-stream;

      gzip_types text/plain text/xml text/css
                   text/comma-separated-values
                   text/javascript application/x-javascript
                   application/atom+xml;

      log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

      access_log  /var/log/nginx/access.log  main;

      sendfile        off;
      #tcp_nopush     on;
      keepalive_timeout  65;
      #gzip  on;
      include /etc/nginx/conf.d/*.conf;
}

但Chrome不会喜欢它! Safari上没问题!

是否支持Chrome特定的csv?

由于

1 个答案:

答案 0 :(得分:0)

我通过添加:

解决了这个问题
update

到我定义我的具体位置的nginx webapp.conf文件中:

add_header  Content-Type    text/csv;

希望这有助于解决同类问题的人们!