diff --git a/ui/oce/index.jsx b/ui/oce/index.jsx index cc7791cfe..c66d7c2e6 100644 --- a/ui/oce/index.jsx +++ b/ui/oce/index.jsx @@ -202,17 +202,18 @@ export default class OCApp extends React.Component{ downloadExcel(){ this.setState({exporting: true}); - let url = new URI('/api/ocds/excelExport').addSearch(this.state.filters.toJS()).addSearch('year', this.state.selectedYears.toArray()); - fetch(url.clone().query(""), { + let url = new URI('/api/ocds/excelExport').addSearch(this.state.filters.toJS()).addSearch('year', this.state.selectedYears.toArray()); + fetch(url.clone().query(""), { method: 'POST', headers: { - 'Content-Type': 'application/x-www-form-urlencoded' + 'Content-Type': 'application/x-www-form-urlencoded' }, - body: url.query() + body: url.query() }).then(callFunc('blob')).then(blob => { var link = document.createElement('a'); link.href = URL.createObjectURL(blob); - link.download = "excel-export.xlsx"; + link.download = "excel-export.xlsx"; + document.body.appendChild(link); link.click(); this.setState({exporting: false}) }).catch((...args) => {