如何从另一个 ftp 服务器将文件下载到我的服务器
我是一名房地产经纪人/网页设计师。我正在尝试编写一个脚本来从 ftp 服务器下载 zip 文件到我的服务器。我的网站都是php/mysql。我遇到的问题是我实际上无法登录到 ftp 服务器。该文件是通过我可用的链接提供的,但无法访问实际服务器。这是我可以访问的链接。
ftp://1034733:[email protected]/idx_fl_ftp_down/idx_ftmyersbeach_dn/ftmyersbeach_data.zip
php的正常功能为了完成此任务,请给我一个连接错误。 Php 没有访问此服务器的权限...这个问题的任何解决方案对我来说都是救星。我希望使用 cron 作业每天运行这个脚本,这样我就不必实际下载这个文件并将其上传到我的(godaddy)服务器,这是我当前的解决方案(我知道这不是一个好的解决方案!) 。
另外,我可以弄清楚如何自己解压缩文件,因为我已经使用 php 的 zip 扩展完成了一些工作,但是任何有关有效方法的提示也将不胜感激。我正在寻找访问 zip 存档内名为“ftmyers_data.txt”的文本文件
I am a realtor/web designer. I am trying to write a script to download a zip file to my server from a ftp server. My website is all in php/mysql. The problem that I am having is that I cannot actually log in to the ftp server. The file is provided through a link that is available to me, but access to the actual server is not available. Here is the link i have access to.
ftp://1034733:[email protected]/idx_fl_ftp_down/idx_ftmyersbeach_dn/ftmyersbeach_data.zip
php's normal functions for accomplishing this give me a connection error. Php does not have permission to access this server... Any solutions to this problem would be a life saver for me. I am looking to use a cron job to run this script every day so i don't have to physically download this file and upload it to my (godaddy) server, which is my current solution (not a good one, i know!).
Also, I can figure out how to unzip the file myself, as I have done some work with php's zip extension, but any tips for an efficient way to do this would be appreciated as well. I am looking to access a text file inside of the zip archive called "ftmyers_data.txt"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否具有对运行 PHP 应用程序的服务器的 shell 访问权限?如果是这样,您也许可以使用 shell 脚本和 ftp shell 命令自动进行检索。
Do you have shell access to the server on which your PHP application runs? If so, you might be able to automate the retrieval using a shell script and the ftp shell command.
使用 php_curl
就像 pi 一样简单。 :)
Use php_curl
Easy as pi. :)