Home arrow PHP arrow Building An FTP Client With PHP

Building An FTP Client With PHP

Ever wondered how to make your own FTP client with PHP? Look no further. In this article Mitchell teaches you everything you need to do just that.

Author Info:
By: Mitchell Harper
Rating: 4 stars4 stars4 stars4 stars4 stars / 71
July 02, 2002
  1. · Building An FTP Client With PHP
  2. · PHP and FTP 101
  3. · Retrieving a File Listing
  4. · Retrieving a File
  5. · Building an FTP App
  6. · The GetFile function
  7. · Conclusion

print this article

Building An FTP Client With PHP
(Page 1 of 7 )

We've all worked with FTP clients such as WS_FTP, CuteFTP, etc. FTP, or File Transfer Protocol, is the protocol that handles the copying of a file from one computer to another computer, either on the local or a remote network.

FTP is a standard protocol, and as such has its own RFC (Request For Comments) file, which is located at http://www.faqs.org/rfcs/rfc959.html. If you take a look at the 61 page FTP RFC, then you might find it a bit hard to learn all of the commands that you need to talk to a server using raw FTP commands. Luckily for us, PHP abstracts the raw FTP commands and provides functionality that allows us to easily connect to an FTP server, send files, retrieve and delete files, etc.

In this article we’re going to examine PHP's set of functions that allow us to interface with a remote server using the FTP protocol. We will learn how to connect to an FTP server, how to send and receive files, and also how to traverse directories amongst other things. We will top it all off by building a useable web based FTP application.

The FTP extension for PHP comes as standard with all Windows binary versions of PHP, however if you've got PHP installed on a Linux/Unix server then you’ll need to make sure that it was compiled with PHP support (--enable-ftp). To do this, just create a PHP script containing <?php echo phpinfo(); ?> and run it through your browser. Look for the FTP section and make sure FTP support is enabled.
blog comments powered by Disqus

- Removing Singletons in PHP
- Singletons in PHP
- Implement Facebook Javascript SDK with PHP
- Making Usage Statistics in PHP
- Installing PHP under Windows: Further Config...
- File Version Management in PHP
- Statistical View of Data in a Clustered Bar ...
- Creating a Multi-File Upload Script in PHP
- Executing Microsoft SQL Server Stored Proced...
- Code 10x More Efficiently Using Data Access ...
- A Few Tips for Speeding Up PHP Code
- The Modular Web Page
- Quick E-Commerce with PHP and PayPal
- Regression Testing With JMeter
- Building an Iterator with PHP

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials