Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Developing a Robust Ftp Client in PHP
August 6, 2008, 4:57 pm
rate this thread
I've been tasked with developing a lightweight ftp client for use in
web servers. Obviously, there is no need to redesign the wheel, and
I've basically just been wrapping a class around the ftp library
functions in the php library. Now, this class works great for most
purposes, however, when it encounters a flaky ftp server, I can get
disconnected without warning.
So basically, what is the best way to handle disconnects? I want to
auto-reconnect to an ftp, I think that is the most sensible
solution(if anyone has a better one, please let me know). Is there
anyway to register a callback function that is called when
disconnected from an ftp? If not, is there anyway to poll the status
of the current ftp connection? Possibly I should just have a loop
that sleeps, calls ftp_nlist(), if that fails then it attempts to
reconnect. Then I could just spawn an ftp_client thread that
continuously monitors the ftp connection until killed. Seems like
overkill to me though.. I dunno, anyone have any better ideas?
- C. (http://symcbean.blogspot.c
August 6, 2008, 5:15 pm
Re: Developing a Robust Ftp Client in PHP
Top of my list would be not to use ftp (have a google for previous
rants). But since that's not an option, next solution would be to use
a seperate connection for each transaction, closing it when completed,
and always checking for errors along the way.
There's not a lot you can do to fix other peoples' problems.
- » ssh on command line: force using a group size (prime size) of 1024 (and no...
- — The site's Newest Thread. Posted in » Secure Shell Forum