PHP
  Home arrow PHP arrow Page 2 - Stream Me Up, Scotty! (part 1)
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Moblin 
JMSL Numerical Library 
VPS Hosting 
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

Stream Me Up, Scotty! (part 1)
By: Vikram Vaswani, (c) Melonfire
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 2 stars2 stars2 stars2 stars2 stars / 4
    2000-11-07

    Table of Contents:
  • Stream Me Up, Scotty! (part 1)
  • Out With The Old...
  • ...In With The New
  • Where Am I?
  • GETting It Right
  • Start Me Up!
  • Lights! Camera! Action!
  • Well-Formed Ideas
  • Appendix: Code Listing

  • 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


    Stream Me Up, Scotty! (part 1) - Out With The Old...


    (Page 2 of 9 )

    The first thing you should know is that PHP allows file transfer across both HTTP and FTP connections. The ability to upload files over HTTP has been available since PHP3, while the newer FTP functions have made an appearance only in later versions of PHP3 and in PHP4.

    Before we begin, you need to make sure that your version of PHP includes FTP support. You can check this by creating a PHP file containing the code

    <? phpinfo(); ?>
    and checking the resulting output through your Web browser. There's a section named "Additional Modules" which lists the modules supported by your build; in case you don't find the FTP module listed, you'll need to recompile your build with FTP support.

    To start with, let's refresh your memory of what a typical FTP session looks like:

    $ ftp ftp.server.com Connected to ftp.server.com 220 server.com FTP server ready. Name (server:john): john 331 Password required for john. Password: 230 User john logged in. Remote system type is UNIX. Using binary mode to transfer files. ftp> ls 200 PORT command successful. 150 Opening ASCII mode data connection for /bin/ls. drwxr-xr-x 5 john users 3072 Nov 2 11:03 . drwxr-xr-x 88 root root 2048 Nov 1 23:26 .. drwxr--r-- 2 john users 1024 Oct 5 13:26 bin drwx--x--x 8 john users 1024 Nov 2 10:59 public_html drwxr--r-- 4 john users 1024 Nov 2 11:26 tmp -rw-r--r-- 1 john users 2941465 Oct 9 17:21 data.zip 226 Transfer complete. ftp> bin 200 Type set to I. ftp> get data.zip local: data.zip remote: data.zip 200 PORT command successful. 150 Opening BINARY mode data connection for data.zip(2941465 bytes). 226 Transfer complete. ftp> bye 221 Goodbye.
    As you can see, the process can be broken down into clearly-identifiable segments. There's the connection phase (which opens a connection to the FTP server); the authentication phase (where the user identifies himself or herself and is permitted access to the FTP site); the transaction phase (which involves operations like directory navigation, file listing, and file GET or PUT); and the disconnection phase (which terminates the FTP connection cleanly). Nice and symmetrical, right?

    This article copyright Melonfire 2000. All rights reserved.

    More PHP Articles
    More By Vikram Vaswani, (c) Melonfire


     

       

    PHP ARTICLES

    - Building a Database-Driven Application with ...
    - User Authentication for a Project Management...
    - Introduction to the CodeIgniter PHP Framework
    - Adding Users for a Project Management Applic...
    - Migrating Class Code for a MIME Email to PHP...
    - Login and Logout Authentication for a Projec...
    - Composing Messages in HTML for MIME Email wi...
    - Project Management: Authentication
    - A Better Way to Determine MIME Types for MIM...
    - Project Management Overview
    - Handling Attachments in MIME Email with PHP
    - Completing the Project Management Application
    - Sending MIME Email with PHP
    - Handling Files for a Project Management Appl...
    - Viewing and Editing Tasks for a Project Mana...





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