The ftp_nb_put() function uploads a local file to the FTP server. (no blocking)
This function returns one of the following values:
FTP_FAILED (send/get failed)
FTP_FINISHED (send/get successful)
FTP_MOREDATA (send/get in progress)
Unlike ftp_put(), this function fetches the file asynchronously. This means your program can perform other operations while the file is downloading.
ftp_nb_put(ftp_connection,remote,local,mode,resume)
parameter | describe |
---|---|
ftp_connection | Required. Specifies the FTP connection to use. |
remote | Required. Specifies uploading files saved on the FTP server. |
local | Required. Specifies the path of the file to be uploaded. |
mode | Required. Specifies the transmission mode. Possible values: FTP_ASCII FTP_BINARY |
resume | Optional. Specifies where in the local file to start copying. The default is 0. |
This example copies text from "source.txt" to "target.txt":
<?php$conn = ftp_connect("ftp.testftp.com") or die("Could not connect");ftp_login($conn,"admin","ert456");ftp_nb_put($conn,"target.txt" ,"source.txt",FTP_ASCII);ftp_close($conn);?>