Web Based FTP with Raw Sockets and PHP
As mentioned at the start of the first part of this article, our web based FTP software will be built using raw sockets. We do not rely on the FTP functions built into PHP.
Before we get down to business let's look at how web based File Transfer Protocol client differs from a standalone clients. (skip ahead if you would rather get into the coding instead of reading this commentary.)
|Web based Based vs Stand Alone FTP clients|
As the above diagram shows, with web based FTP there isn't a direct connection between the end user's computer and the server. This is very usefull if you are working behind a firewall. Some idiotic ISPs use firewalls to block all ports expect 80, which is used by HTTP. The familiar web based email systems also have a similar architecture.
A user trapped behind such a firewall cannot make use of the File Transfer Protocol or many of the other usefull protocols that we take for granted. Web based clients work through an intermediate webserver, which allows users behind such firewalls to make use the File Transfer Protocol.
There are a small number of FTP applets (including the one by Rad Inks), although are are also called web based clients they do not fit the description given above. Their behaviour is closer to standard desktop software.