通过PHP下载图片文件
通过PHP下载图片文件, 不需要使用右键另存为等这样的操作, 直接下载.
$img = substr($row['bqpath'], strrpos($row['bqpath'], '/')+1); $ext = substr($row['bqpath'], strrpos($row['bqpath'], '.')+1); header('Content-Type: image/'.$ext); header("Content-Disposition:attachment;filename=".$img); header('Content-Transfer-Encoding: binary'); readfile(WEB_PATH.$row['bqpath']);
其他文件的下载同理…
贵站这是个我这种菜鸟学习的好地方啊~
想和贵搏友链~不知口否
万维网事:www.wanvee.info
欢迎首页互连.
@flywolf
博主真是神速啊!
谢谢了,贵站首页链接已添加!
博客做的不错吗