连接速度慢时文件下载不完整
我在网站(Apache 网络服务器)上有一个 15MB 的文件,在合理的速度连接下可以很好地下载,但在较慢的连接(例如 28KBytes/sec)上几乎总是不完整。不完整文件的大小是随机的,从 2 到 13 MB。我已经验证了 Safari 和 Firefox 中的行为,连接延迟可以忽略不计。这两个浏览器都不会向用户指示文件不完整,但大小小于 15MB。我尝试通过直接链接和带有正确标头的 PHP 下载脚本进行下载:结果相同。
还有其他人遇到过这种问题吗?
I have a 15MB file on a website (Apache webserver) that downloads fine on reasonable speed connections, but is almost always incomplete on slower connections (28KBytes/sec, for example). The size of the incomplete file is random, from 2 to 13 MB. I have verified the behavior in both Safari and Firefox, on a connection with negligible latency. Neither browser indicates to the user that the file is incomplete, but the size is smaller than 15MB. I have tried downloading via a direct link and via a PHP download script with the proper headers: same results.
Has anyone else experienced this kind of issue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您使用 PHP 脚本发送文件,您将遇到 PHP 脚本对大型下载的限制。请参阅 php.ini 了解 max_execution_time。
因此,您不想使用 PHP 读取文件,然后将其回显到浏览器。
相反,您希望将浏览器重定向到该文件。
If you use your PHP script for sending the file you will run into PHPs script limit on large downloads. See php.ini for max_execution_time.
So you don't want to read your file with PHP and then echo it to the browser.
Instead you like to redirect the browser to the file.