Javatpoint Logo
Javatpoint Logo

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:

Parameter Description Is compulsory
ftp_stream The link identifier of the FTP connection. compulsory
handle An open file pointer on the local file. Reading stops at the end of the file. compulsory
remote_file The remote file path. compulsory
mode The transfer mode. Must be either FTP_ASCII or FTP_BINARY compulsory
resumepos The 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





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA