开发者

Host no longer supports PHP functions for FTP! Workaround?

开发者 https://www.devze.com 2022-12-13 11:48 出处:网络
So my host just updated all their hardware and software and they have decided to no longer support any of the PHP FTP function开发者_C百科s (ftp_connect, etc).

So my host just updated all their hardware and software and they have decided to no longer support any of the PHP FTP function开发者_C百科s (ftp_connect, etc).

Anyone know a way around this? Luckily I have classed all my PHP functions so I will only need to build the work around once (If there is one?)

Maybe Upload using fSocket? Any examples / tutorials would be appreciated.


CURL is a good option.

file_get/put_contents with contexts may also be an option.


FTP is supported with file commands, so you can do this to upload:

file_put_contents("ftp://user:pass@server/path/to/file.ext", $filecontent);

See this page for what functions the FTP wrapper supports in PHP 4 and 5.


this looks promising. at least from the description it sounds just like what you're looking for. I didn't try it (as I don't have an account on that site) but it might be worth checking out. Why reinvent the wheel...

0

精彩评论

暂无评论...
验证码 换一张
取 消