相关疑难解决方法(0)

使用PHP发送文件时可恢复下载?

我们使用PHP脚本来进行隧道文件下载,因为我们不希望公开可下载文件的绝对路径:

header("Content-Type: $ctype");
header("Content-Length: " . filesize($file));
header("Content-Disposition: attachment; filename=\"$fileName\"");
readfile($file);
Run Code Online (Sandbox Code Playgroud)

不幸的是,我们注意到最终用户无法恢复通过此脚本传递的下载.

有没有办法支持这种基于PHP的解决方案的可恢复下载?

php download resume-download

101
推荐指数
6
解决办法
6万
查看次数

PHP - 将文件发送给用户

我在磁盘上有一个pdf文件,当他们向php脚本发出请求时,我需要发送给用户,这样做的最佳方法是什么?

谢谢

php

44
推荐指数
3
解决办法
8万
查看次数

标签 统计

php ×2

download ×1

resume-download ×1