test.php
<?php
if (!file_exists($file) || !is_file($file)) {
header("HTTP/1.1 404 Not Found");
exit;
}$size = filesize($file);
header("Content-Type: application/octet-stream");
header("Accept-Ranges: bytes");
header("Content-Length: " . $size);
header("Content-Disposition: attachment; filename=" . basename($file));
readfile($file);
?>所谓get方法就是:test.php?file=文件名,如:
test.php?file=test.zip
<?php
if (!file_exists($file) || !is_file($file)) {
header("HTTP/1.1 404 Not Found");
exit;
}$size = filesize($file);
header("Content-Type: application/octet-stream");
header("Accept-Ranges: bytes");
header("Content-Length: " . $size);
header("Content-Disposition: attachment; filename=" . basename($file));
readfile($file);
?>所谓get方法就是:test.php?file=文件名,如:
test.php?file=test.zip
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货