Php 下载文件,不保存在服务器中
或者用户可以下载文件而不将其保存在服务器上? 我正在从数据库获取数据,我想保存它们.doc(MS Word)文件 } 如果没有以下内容,代码应该是什么样子: “$fh=fopen($file,'w');Php 下载文件,不保存在服务器中,php,header,Php,Header,或者用户可以下载文件而不将其保存在服务器上? 我正在从数据库获取数据,我想保存它们.doc(MS Word)文件 } 如果没有以下内容,代码应该是什么样子: “$fh=fopen($file,'w'); fwrite($fh,$stringData); fclose($fh);” 还有这个“取消链接($file);” 我希望了解我需要什么 在此处输入代码您只需输出标题,然后输出内容: header(...); echo $stringData; 无需播放任何文件。您只需输出标题,然后输出内容
fwrite($fh,$stringData); fclose($fh);” 还有这个“取消链接($file);” 我希望了解我需要什么
在此处输入代码您只需输出标题,然后输出内容:
header(...);
echo $stringData;
无需播放任何文件。您只需输出标题,然后输出内容:
header(...);
echo $stringData;
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment;
filename=\"$_fileName\"");
ob_clean();
readfile($_filePath);
不需要玩任何文件
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment;
filename=\"$_fileName\"");
ob_clean();
readfile($_filePath);