【发布时间】:2020-10-31 06:15:22
【问题描述】:
我的情况是,我需要从 URL 下载文件,使用像 https://somedomain.com/some-path/somefile.exe 这样的直接文件 URL 很容易
file_put_contents( $save_file_loc, file_get_contents($url_to_download);
但是当您延迟从实际打印 HTML 的 URL 强制下载以及如何区分这些 URL 时该怎么办?
示例网址:https://filehippo.com/download_mozilla-firefox-64/post_download/
编辑:在上面的 url 上,文件下载使用 JS 开始,因为我用阻塞 JS 测试并且下载没有开始。
提前感谢您的帮助。
【问题讨论】:
-
这能回答你的问题吗? How to force file download with PHP
-
即输出文件。我需要相反的东西。我已经给出了 URL:filehippo.com/download_mozilla-firefox-64/post_download 我需要使用 PHP 从中下载。
标签: php download file-get-contents php-curl file-put-contents