gpt4 book ai didi

curl - 使用 curl 从 php 服务器下载文件

转载 作者:行者123 更新时间:2023-12-04 18:49:00 27 4
gpt4 key购买 nike

关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。












想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。

8年前关闭。




Improve this question




我正在尝试编写一个脚本,该脚本将从 lazyfoo.net 的教程中下载所有源 Material 。该文件的示例下载链接是

http://lazyfoo.net/downloads/index.php?file=SDLTut_lesson16

我使用这个命令:
curl http://lazyfoo.net/downloads/index.php?file=SDLTut_lesson13 --O lesson13.zip
这让我得到这个回应,但没有文件:

 % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0

我错过了一些明显的东西吗?

最佳答案

您将收到 302 重定向。使用 -L选项

curl http://lazyfoo.net/downloads/index.php?file=SDLTut_lesson13 -L --O lesson13.zip

将来也是 -v (代表详细)对于调试很有用。

关于curl - 使用 curl 从 php 服务器下载文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9122914/

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