diff --git a/main/src/com/google/refine/exporters/XlsExporter.java b/main/src/com/google/refine/exporters/XlsExporter.java index 59e005fa4..18458ac37 100644 --- a/main/src/com/google/refine/exporters/XlsExporter.java +++ b/main/src/com/google/refine/exporters/XlsExporter.java @@ -65,7 +65,7 @@ public class XlsExporter implements StreamExporter { @Override public String getContentType() { - return xml ? "application/xlsx" : "application/xls"; + return xml ? "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" : "application/vnd.ms-excel"; } @Override diff --git a/main/tests/server/src/com/google/refine/exporters/XlsExporterTests.java b/main/tests/server/src/com/google/refine/exporters/XlsExporterTests.java index 221ce30a3..1bae65113 100644 --- a/main/tests/server/src/com/google/refine/exporters/XlsExporterTests.java +++ b/main/tests/server/src/com/google/refine/exporters/XlsExporterTests.java @@ -106,6 +106,11 @@ public class XlsExporterTests extends RefineTest { options = null; } + @Test + public void getContentType(){ + Assert.assertEquals(SUT.getContentType(), "application/vnd.ms-excel"); + } + @Test public void exportSimpleXls(){ CreateGrid(2, 2); diff --git a/main/tests/server/src/com/google/refine/exporters/XlsxExporterTests.java b/main/tests/server/src/com/google/refine/exporters/XlsxExporterTests.java index 23ad37489..0c8c1a6a7 100644 --- a/main/tests/server/src/com/google/refine/exporters/XlsxExporterTests.java +++ b/main/tests/server/src/com/google/refine/exporters/XlsxExporterTests.java @@ -110,6 +110,11 @@ public class XlsxExporterTests extends RefineTest { options = null; } + @Test + public void getContentType(){ + Assert.assertEquals(SUT.getContentType(), "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + } + @Test public void exportSimpleXlsx(){ CreateGrid(2, 2); diff --git a/main/webapp/modules/core/MOD-INF/controller.js b/main/webapp/modules/core/MOD-INF/controller.js index 828cac301..40a898bb3 100644 --- a/main/webapp/modules/core/MOD-INF/controller.js +++ b/main/webapp/modules/core/MOD-INF/controller.js @@ -291,7 +291,9 @@ function registerImporting() { IM.registerMimeType("application/x-excel", "binary/text/xml/xls/xlsx"); IM.registerMimeType("application/xls", "binary/text/xml/xls/xlsx"); IM.registerMimeType("application/x-xls", "binary/text/xml/xls/xlsx"); - + IM.registerMimeType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "binary/text/xml/xls/xlsx"); + IM.registerMimeType("application/vnd.openxmlformats-officedocument.spreadsheetml.template", "binary/text/xml/xls/xlsx"); + IM.registerMimeType("application/vnd.oasis.opendocument.spreadsheet","text/xml/ods"); IM.registerMimeType("application/json", "text/json");