跳转到另一个网页实现下载文件
<?php header("location:index.php"); ?>
<?php //index.php $file=‘1.txt‘; //paths $filename=‘someother.txt‘; //download name header("content-type:application/force-download"); header("content-disposition:attachment;filename=".$filename.""); readfile(‘1.txt‘); ?>
时间: 2024-11-01 18:26:59