PHP
  Home arrow PHP arrow Building An FTP Client With PHP
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Dedicated Servers  
Actuate Whitepapers 
Moblin 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

Building An FTP Client With PHP
By: Mitchell Harper
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 44
    2002-07-02

    Table of Contents:
  • Building An FTP Client With PHP
  • PHP and FTP 101
  • Retrieving a File Listing
  • Retrieving a File
  • Building an FTP App
  • The GetFile function
  • Conclusion

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Building An FTP Client With PHP


    (Page 1 of 7 )

    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.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.

    More PHP Articles
    More By Mitchell Harper


     

    PHP ARTICLES

    - 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
    - PHP Frontend to ImageMagick
    - Using PEAR's mimeDecode Module
    - Incoming Mail and PHP


    IBM developerWorks





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway