如何将另一个网站文件下载到我的网站中?
您好,我有一个 domain.com 网站,我想知道如何将具有简单 url 的文件下载到我的网站空间中?是使用 shell 脚本还是什么?
hi I have a domain.com website and I was wondering how would I download a file with simple url into my website space ? is it using shell scripts or what ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
使用 wget 或 Windows 版 wget
use wget or wget for windows
这取决于您在网络服务器上可用的工具。如果您有 ssh 访问权限,并且服务器上安装了 wget 或 curl,那么这将是最简单的方法:通过 ssh 进入服务器,然后发出如下命令:
如果您没有 ssh 访问权限,您将需要使用服务器上可用的任何脚本语言编写脚本,确保它受到适当的保护,然后运行它。
It depends on the tools you have available on the web server. If you have ssh access, and either wget or curl is installed on the server, then that would be the easiest way: ssh into the server, and the issue a command like this:
If you don't have ssh access, you'll need to write a script in whatever scripting language you have available on the server, make sure it's properly protected, and then run it.
这完全取决于您对服务器的访问类型。
例如,当您具有 shell 访问权限时,您可以执行简单的
wget
来下载文件,然后只需将其移动到正确的位置即可。否则,如果它是共享主机并且您只有 ftp 访问权限,则可以在可以执行的服务器上放置一个脚本,然后下载远程文件。
That completely depends on what kind of access you have to the server.
When you have shell access, for example you could do a simple
wget <url>
to download a file, and then you would just move it to the correct location.Otherwise, if it is shared hosting and you only have ftp access, you can put a script on the server you can executes that then downloads a remote file.