The server response data like this:
My angular code:
$scope.export = function() {
var datas = new Blob([data], { type: 'application/vnd.ms-excel;charset=UTF-8' });
FileSaver.saveAs(datas, '2016-04-20.xlsx');
}
And Header:
Accept-Range:bytes
Connection:keep-alive
Content-Disposition:attachment; filename=%E8%A1%A5%E8%B4%B4%E8%B5%84%E6%A0%BC%E5%B7%B2%E5%AE%A1%E6%A0%B8%E4%BF%A1%E6%81%AF%E8%A1%A8.xlsx
Date:Tue, 19 Apr 2016 17:23:06 GMT
Transfer-Encoding:chunked
X-Powered-By:Express
Dependencies Angular, FileSaver.js, Blob.js
But i got a wrong file, and can not open, how can i fixed this problem? Thanks!