gpt4 book ai didi

php header 循环下载多个文件

转载 作者:塔克拉玛干 更新时间:2023-11-03 06:01:50 26 4
gpt4 key购买 nike

我正在即时创建 pdf 文件,我想使用 php 下载多个文件。我可以这样写标题吗

<?php
header('Content-type: application/pdf');
header('Content-Disposition: attachment; filename="downloaded.pdf"');
readfile('original.pdf');
?>

在 while 循环中?

最佳答案

简短的回答是否定的,您需要一些东西来告诉客户内容在哪里结束,新的标题在哪里开始。您可以使用 zip 实用程序并将它们打包以供下载,或者您可以查看 mime 电子邮件格式(在整个文档中使用分隔符)但我不确定这是否有效HTTP 协议(protocol)而不明确称其为“电子邮件”包。

我只推荐使用 zip 实用程序。生成您需要的 PDF,然后打包并发送。

关于php header 循环下载多个文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4993468/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com