PHP ftp_fput( ) Function

The ftp_fput() function is used to uploads from an open file to the FTP server. This function was introduced in PHP 4.

Syntax:

ParameterDescriptionIs compulsory
ftp_streamThe link identifier of the FTP connection.compulsory
handleAn open file pointer on the local file. Reading stops at the end of the file.compulsory
remote_fileThe remote file path.compulsory
modeThe transfer mode. Must be either FTP_ASCII or FTP_BINARYcompulsory
resumeposThe position in the remote file to start uploading to.Optional

Returns

The ftp_fput() function returns true on success or false on failure.

Example 1

Explanation

In the above example, by using ftp_fget() function Open local file, and upload it to a file on the FTP server.

Example 2

Explanation

In the above example, by using ftp_fput() function we are uploading a open file to the FTP server.


Next TopicPHP FTP




Latest Courses