zoukankan      html  css  js  c++  java
  • node csv

    想实现下载csv文件的功能,内容放在mysql的blob中,在网上找的都是关于csv模块的。

    由于csv的更新,网上的很多方法都用不了,比如csv(),现在已经变了:http://csv.adaltas.com/csv/examples/

    通过sudo npm install csv安装的csv模块,里面的example也是上述网址中得example。

    后来想想,当时把csv的内容直接存到blob中,现在把它拿出来,直接下载就好,应该不需要通过csv来处理,可以试一下。

    下载csv:http://www.nodeclass.com/articles/89571

    var filename = 'sfp.csv';
    res.set({
         // 文件扩展名:.xls 'Content-Type': 'application/vnd.ms-excel',
         // 当用户想把请求所得的内容存为一个文件的时候提供一个默认的文件名 'Content-Disposition': 'attachment;filename='+filename,
         //关于Pragma:no-cache,跟Cache-Control: no-cache相同。Pragma: no-cache兼容http 1.0 ,Cache-Control: no-cache是http 1.1提供的。因此,Pragma: no-cache可以应用到http 1.0 和http 1.1,而Cache-Control: no-cache只能应用于http 1.1. 'Pragma': 'no-cache', 'Expires': 0,
         'Cache-Control': 'No-cache' }); var str = 'Male,Female 54.,43. 23.,34. 45.,65. 54.,77. 45.,46. ,65.'; res.send(str);

      

  • 相关阅读:
    linux下的apue.3e安装[Unix环境高级编程]
    mysql将主键序号置为1
    玛丽全开-许愿池
    redis学习之路

    jvm
    oracle版本号含义
    oracle查看所有的表空间
    oracle存储过程 package
    oracle同义词创建(synonym)
  • 原文地址:https://www.cnblogs.com/wang-jing/p/4840826.html
Copyright © 2011-2022 走看看