怎么不生成.DOC文件的情况提供下载
Jun 13, 2016 am 10:03 AM
如何不生成.DOC文件的情况提供下载
现在要做这样一个功能,在点击的时候提取数据库内容,并下载成.DOC文件
但是在服务器上不要生成文件,只有在点击的时候在缓存里直接生成文件并下载
目前生成文件并下载我已经做到了
就是不知道如何不在生成文件的情况下直接点击下载
------解决方案--------------------
在HEADER配置完以后,直接用echo $content
$content就是你需要的内容,可以先组织好了,一下打出来就可以了.这其实是跟读文件同样的道理,只是不用生成文件.
------解决方案--------------------
[code=php]
header("Content-type: application/msword");
echo "这里放入存了文档内容的变量";
[/code]

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How does SpringBoot pass parameters in the Header through Feign calls?

Five selected Go language open source projects to take you to explore the technology world

Go language development essentials: 5 popular framework recommendations

What is the difference between html5 tag head and header?

Implementing distributed task scheduling using Golang's web framework Echo framework

How to use PHP header() method to adjust web pages
