shilang 发表于 2017-3-30 12:30:39

force file download with PHP

$file_url = 'http://www.myremoteserver.com/file.exe';
header('Content-Type: application/octet-stream');
header("Content-Transfer-Encoding: Binary");
header("Content-disposition: attachment; filename=\"" . basename($file_url) . "\"");
readfile($file_url);
页: [1]
查看完整版本: force file download with PHP