PHP FTP Functions

EditRocket provides the following information on FTP functions in the PHP source code builder.

bool ftp_alloc ( resource $ftp_stream , int $filesize [, string &$result ] ) - Sends an ALLO command to the remote FTP server to allocate space for a file to be uploaded.

bool ftp_cdup ( resource $ftp_stream ) - Changes to the parent directory.

bool ftp_chdir ( resource $ftp_stream , string $directory ) - Changes the current directory to the specified one.

int ftp_chmod ( resource $ftp_stream , int $mode , string $filename ) - Sets the permissions on the specified remote file to mode.

bool ftp_close ( resource $ftp_stream ) -

resource ftp_connect ( string $host [, int $port [, int $timeout ]] ) - ftp_connect() opens an FTP connection to the specified host.

bool ftp_delete ( resource $ftp_stream , string $path ) - ftp_delete() deletes the file specified by path from the FTP server.

bool ftp_exec ( resource $ftp_stream , string $command ) - Sends a SITE EXEC command request to the FTP server.

bool ftp_fget ( resource $ftp_stream , resource $handle , string $remote_file , int $mode [, int $resumepos ] ) - ftp_fget() retrieves remote_file from the FTP server, and writes it to the given file pointer.

bool ftp_fput ( resource $ftp_stream , string $remote_file , resource $handle , int $mode [, int $startpos ] ) - ftp_fput() uploads the data from a file pointer to a remote file on the FTP server.

bool ftp_get ( resource $ftp_stream , string $local_file , string $remote_file , int $mode [, int $resumepos ] ) - ftp_get() retrieves a remote file from the FTP server, and saves it into a local file.

mixed ftp_get_option ( resource $ftp_stream , int $option ) - This function returns the value for the requested option from the specified FTP connection.

bool ftp_login ( resource $ftp_stream , string $username , string $password ) - Logs in to the given FTP stream.

int ftp_mdtm ( resource $ftp_stream , string $remote_file ) - ftp_mdtm() gets the last modified time for a remote file.

string ftp_mkdir ( resource $ftp_stream , string $directory ) - Creates the specified directory on the FTP server.

int ftp_nb_continue ( resource $ftp_stream ) - Continues retrieving/sending a file non-blocking.

int ftp_nb_fget ( resource $ftp_stream , resource $handle , string $remote_file , int $mode [, int $resumepos ] ) - ftp_nb_fget() retrieves a remote file from the FTP server.

int ftp_nb_fput ( resource $ftp_stream , string $remote_file , resource $handle , int $mode [, int $startpos ] ) - ftp_nb_fput() uploads the data from a file pointer to a remote file on the FTP server.

int ftp_nb_get ( resource $ftp_stream , string $local_file , string $remote_file , int $mode [, int $resumepos ] ) - ftp_nb_get() retrieves a remote file from the FTP server, and saves it into a local file.

int ftp_nb_put ( resource $ftp_stream , string $remote_file , string $local_file , int $mode [, int $startpos ] ) - ftp_nb_put() stores a local file on the FTP server.

array ftp_nlist ( resource $ftp_stream , string $directory ) -

bool ftp_pasv ( resource $ftp_stream , bool $pasv ) - ftp_pasv() turns on or off passive mode. In passive mode, data connections are initiated by the client, rather than by the server. It may be needed if the client is behind firewall.

bool ftp_put ( resource $ftp_stream , string $remote_file , string $local_file , int $mode [, int $startpos ] ) - ftp_put() stores a local file on the FTP server.

string ftp_pwd ( resource $ftp_stream ) -

-

array ftp_raw ( resource $ftp_stream , string $command ) - Sends an arbitrary command to the FTP server.

array ftp_rawlist ( resource $ftp_stream , string $directory [, bool $recursive ] ) - ftp_rawlist() executes the FTP LIST command, and returns the result as an array.

bool ftp_rename ( resource $ftp_stream , string $oldname , string $newname ) - ftp_rename() renames a file or a directory on the FTP server.

bool ftp_rmdir ( resource $ftp_stream , string $directory ) - Removes the specified directory on the FTP server.

bool ftp_set_option ( resource $ftp_stream , int $option , mixed $value ) - This function controls various runtime options for the specified FTP stream.

bool ftp_site ( resource $ftp_stream , string $command ) - ftp_site() sends the given SITE command to the FTP server.

int ftp_size ( resource $ftp_stream , string $remote_file ) - ftp_size() returns the size of the given file in bytes.

resource ftp_ssl_connect ( string $host [, int $port [, int $timeout ]] ) - ftp_ssl_connect() opens a SSL-FTP connection to the specified host.

string ftp_systype ( resource $ftp_stream ) - Returns the system type identifier of the remote FTP server.