首先你要保证http响应头中content-type要正确,我给你贴一段node.js的代码: res.set('Content-Type','application/force-download'); res.set('Content-Disposition','attachment;filename='+id+'.txt'); res.write('{"key":"value"}'); res.end();
首先你要保证http响应头中content-type要正确,我给你贴一段node.js的代码: