what is the most reliable method to get a file from remote server in php
I am writing a PHP script that will be installed on a users server. I want to pull a file from MY remote server (a zip file) and write it to the local server that the script is running on.
I can do it just fine use file_get_contents and also using Snoopy.
However, the issue is that my script will be distributed to lots of people who will have a variety of servers. They will range from freebie webspace to their own dedicated rack with everything in between :) I can't be certain that the correct options will be enabled for file_get_contents to work and I know that, if certain options are disabled, it will be unlikely that the user will be able to get them enabled.
So, I am thinking that, pretty much, the only thing I can guarantee is the they will have PHP 4 + what is the best way to pull the remote file - IE: Which way has the best chance of working on such a large range of webservers :
Any ideas or comments would be MUCH appreciated :)
链接地址: http://www.djcxy.com/p/65600.html