Make sure that you set the Content-Type correctly at the server side.
For example, in Node for Excel 2007 and above .xlsx files
response.writeHead(200, {"Content-Type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});
Chrome is probably interpreting your content as application/zip
response.writeHead(200, {"Content-Type": "application/zip"});
Here is an example of an xlsx being served up in Chrome when accessing localhost:1215
var http = require("http");
fileSystem = require('fs'),
path = require('path');
var server = http.createServer(function(request, response) {
var filePath = path.join(__dirname, '1775IronHorse.xlsx');
var stat = fileSystem.statSync(filePath);
response.writeHead(200, { "Content-Type": "application/vnd.openxmlformats- officedocument.spreadsheetml.sheet",
'Content-Length': stat.size
});
var readStream = fileSystem.createReadStream(filePath);
readStream.pipe(response);
});
server.listen(1215);
console.log("Server is listening");
The file downloads correctly as an xlsx.
When I remove the Content-Type Header the file is interpreted as zip file by Chrome. Therefore, the solution is to add the Content-Type Header.
Source