Langsung ke konten utama

PHP FTP Introduction

The FTP functions give client access to file servers through the File Transfer Protocol (FTP).
The FTP functions are used to open, login and close connections, as well as upload, download, rename, delete, and get information on files from file servers. Not all of the FTP functions will work with every server or return the same results. The FTP functions became available with PHP 3.
These functions are meant for detailed access to an FTP server. If you only wish to read from or write to a file on an FTP server, consider using the ftp:// wrapper with the Filesystem functions.

Installation

The windows version of PHP has built-in support for the FTP extension. So, the FTP functions will work automatically.
However, if you are running the Linux version of PHP, you will have to compile PHP with --enable-ftp (PHP 4+) or --with-ftp (PHP 3) to get the FTP functions to work.

PHP FTP Functions

PHP: indicates the earliest version of PHP that supports the function.
Function Description PHP
ftp_alloc() Allocates space for a file to be uploaded to the FTP server 5
ftp_cdup() Changes the current directory to the parent directory on the FTP server 3
ftp_chdir() Changes the current directory on the FTP server 3
ftp_chmod() Sets permissions on a file via FTP 5
ftp_close() Closes an FTP connection 4
ftp_connect() Opens an FTP connection 3
ftp_delete() Deletes a file on the FTP server 3
ftp_exec() Executes a program/command on the FTP server 4
ftp_fget() Downloads a file from the FTP server and saves it to an open file 3
ftp_fput() Uploads from an open file and saves it to a file on the FTP server 3
ftp_get_option() Returns runtime behaviors of the FTP connection 4
ftp_get() Downloads a file from the FTP server 3
ftp_login() Logs on to an FTP connection 3
ftp_mdtm() Returns the last modified time of a specified file 3
ftp_mkdir() Creates a new directory on the FTP server 3
ftp_nb_continue() Continues retrieving/sending a file (non-blocking) 4
ftp_nb_fget() Downloads a file from the FTP server and saves it to an open file (non-blocking) 4
ftp_nb_fput() Uploads from an open file and saves it to a file on the FTP server (non-blocking) 4
ftp_nb_get() Downloads a file from the FTP server (non-blocking) 4
ftp_nb_put() Uploads a file to the FTP server (non-blocking) 4
ftp_nlist() Lists the files in a specified directory on the FTP server 3
ftp_pasv() Turns passive mode on or off 3
ftp_put() Uploads a file to the FTP server 3
ftp_pwd() Returns the current directory name 3
ftp_quit() Alias of ftp_close() 3
ftp_raw() Sends a raw command to the FTP server 5
ftp_rawlist() Returns a detailed list of files in the specified directory 3
ftp_rename() Renames a file or directory on the FTP server 3
ftp_rmdir() Removes a directory on the FTP server 3
ftp_set_option() Sets runtime options for the FTP connection 4
ftp_site() Sends a SITE command to the server 3
ftp_size() Returns the size of the specified file 3
ftp_ssl_connect() Opens a secure SSL-FTP connection 4
ftp_systype() Returns the system type identifier of the FTP server 3


PHP FTP Constants

PHP: indicates the earliest version of PHP that supports the constant.
Constant Description PHP
FTP_ASCII   3
FTP_TEXT   3
FTP_BINARY   3
FTP_IMAGE   3
FTP_TIMEOUT_SEC   3
FTP_AUTOSEEK   4
FTP_AUTORESUME Determine resume position and start position for get and put requests automatically 4
FTP_FAILED Asynchronous transfer has failed 4
FTP_FINISHED Asynchronous transfer has finished 4
FTP_MOREDATA Asynchronous transfer is still active 4





Komentar

Postingan populer dari blog ini

Alexa Page Rank

Alexa.com is a subsidiary of Amazon.com and is a website which provides information on traffic levels for websites. The Alexa rank is measured according to the amount of users who’ve visited a website with the Alexa toolbar installed. In this article, I’ll examine the importance of the Alexa Rank as it relates to site monetization while briefly discussing some of the weaknesses involved in using Alexa ranking as a reliable traffic measure for any website. Lastly, I’ve also included an extensive list of twenty methods and strategies you can use to increase your Alexa Rank dramatically in the short and long run. What is the Alexa Rank? Put simply, the Alexa Rank is a ranking system which bases its ranking schema on the level of traffic each website receives from the number of people who visit a website with the Alexa toolbar installed. See Alexa’s definition of the Alexa Traffic Rank: The traffic rank is based on three months of aggregated historical traffic data from mill...

Save Forex to SCAM

Forex trading is one of the best home based online business opportunity you can find today. The Big Sharks know that and use the demand for information about Forex market to get every possible dollar in their hands. Who are they? The answer is always easy – Follow the Money. There is one player on currency market (and in every other market) who never loses his share in every single trade. Brokerage service on Forex trading is claimed to be commission free, right? But you always pay your minimum 3 to 10 pips fee on each trade. Where those 3 to 10 pips go? Make your best guess! There is almost no chance for a person who has no idea for the forces driving the Info market to save himself from being robbed and abused by those well advertised money machines. You can see their banners on your e-mail provider. You can watch their infomercials on every TV channel. Be aware about the presence of those Big Sharks and be sure that the information they will try to sell to you is always availa...