var file = __dirname + '/test.json';
var filename = path.basename(file);
var mimetype = mime.lookup(file);
res.setHeader('Content-disposition', 'attachment; filename=test.json');
res.setHeader('Content-type', 'application/javascript');
var filestream = fs.createReadStream(file);
filestream.pipe(res);
沒有留言:
張貼留言