gpt4 book ai didi

php - 用于下载文件 php 的 header

转载 作者:行者123 更新时间:2023-12-04 22:31:40 25 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
php, file download

我有一些文件不在网络根目录中,我需要提供这些文件以供下载。所以我有一个使用下面的脚本来下载请求的文件。问题是,我下载的每个文件都已损坏?这些文件没问题,因为如果我使用 FTP 下载,它们会打开。以下是传递的 header :

header($_SERVER["SERVER_PROTOCOL"] . " 200 OK");
header("Cache-Control: public"); // needed for i.e.
header("Content-Type: " . $download[0]['mime']);
header("Content-Disposition: attachment; filename=" .$download_file);
header("Content-Transfer-Encoding: Binary");
header("Content-Length:".filesize($attachment_location));

readfile($attachment_location);

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