例如点击文章的下载按钮,将文章里对应的附件下载下来?
查看更多
输出文件流用于下载
$filePath = $_SERVER['DOCUMENT_ROOT'].$other['sourcefile']; $postfix=strrchr($filePath, '.'); $fileName = $archives["title"].$postfix; header('Content-Disposition:attachment;filename='.$fileName); return file_get_contents($filePath);
发布 问题
分享 好友
手机 浏览
回到 顶部