PHP ftp_fput() Function

The ftp_fput() function uploads from an open file and saves it to a file on the FTP server.

bool ftp_fput ( resource $ftp_stream , string $remote_file , resource $handle [, int $mode = FTP_IMAGE [, int $startpos = 0 ]] )

ftp_fput() uploads the data from a file pointer to a remote file on the FTP server.

Example -

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

Returns TRUE on success or FALSE on failure.