Home > Backend Development > PHP Tutorial > PHP怎样实现用户点击下载跳出下载页面

PHP怎样实现用户点击下载跳出下载页面

WBOY
Release: 2016-06-23 14:05:49
Original
1060 people have browsed it

PHP怎样实现用户点击下载跳出下载页面??[img=http://][/img]例如这个点击下载!可以实现下载图片的功能


回复讨论(解决方案)

header头下载


	header("Content-Type:text/csv");		header("Content-Disposition:attachment;filename=$file");		readfile("$filename");
Copy after login

$file 是文件名 $filename 是文件目录 
header("Content-Type:text/csv"); 这个格式依需要而定

header功能是干嘛的呢

header功能

同2楼!!!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template