Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PHP ftp_fput() Function

PHP ftp_fput() Function


PHP FTP Reference Manual Complete PHP FTP Reference Manual


Definition and Usage

The ftp_fput() function uploads a local open file and saves it as a file on the FTP server.

Returns TRUE on success, or FALSE on failure.

Syntax

ftp_fput(ftp_connection,remote,local,mode,resume)

Parameters Description
ftp_connection Required. Specifies the FTP connection to use.
remote Required. Specifies the file to be saved on the FTP server.
local Required. Specifies the open file to upload.
mode Required. Specifies the transfer mode. Possible values:
  • FTP_ASCII
  • FTP_BINARY
  • | | resume | Optional. Specifies where in the local file to start copying. Default is 0. |

    Example

    This example copies text from "source.txt" to "target.txt":

    The code above will output:

    1


    PHP FTP Reference Manual Complete PHP FTP Reference Manual