返回顶部

收藏

php强制下载文件的代码

更多
header("Content-type: application/octet-stream");

// displays progress bar when downloading (credits to Felix ;-))
header("Content-Length: " . filesize('myImage.jpg'));

// file name of download file
header('Content-Disposition: attachment; filename="myImage.jpg"');

// reads the file on the server
readfile('myImage.jpg');

标签:强制,下载,php

收藏

0人收藏

支持

0

反对

0

发表评论