doudiyu1639 2016-02-02 10:59
浏览 34

如何从特定位置导出csv文件并可供下载?

Due to Speed issues and threading I have generated a CSV file in a particular location

Admin - CSV - xyz.csv

I want to write a program to just made it available on view. I know how to make a tmp csv and use header function for making downloadable the csv, But I am looking for the approach which only take this xyz.csv available for download on a click. Please Help!

I read out lot of examples but not find exact answer for my question.

As per recommended I have tried.

        header('Content-Type: application/vnd.ms-excel');

        header('Content-Disposition: attachment;filename="data.csv"');

        header('Cache-Control: max-age=0');

        $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'csv');

        $objWriter->save('php://output');

        exit;
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 微信会员卡接入微信支付商户号收款
    • ¥15 如何获取烟草零售终端数据
    • ¥15 数学建模招标中位数问题
    • ¥15 phython路径名过长报错 不知道什么问题
    • ¥15 深度学习中模型转换该怎么实现
    • ¥15 HLs设计手写数字识别程序编译通不过
    • ¥15 Stata外部命令安装问题求帮助!
    • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
    • ¥15 TYPCE母转母,插入认方向
    • ¥15 如何用python向钉钉机器人发送可以放大的图片?