PHP ftp_nb_fput() Function
Complete PHP FTP Reference Manual
Definition and Usage
The ftp_nb_fput() function uploads a local open file and saves it as a file on the FTP server. (Non-blocking)
This function returns one of the following values:
- FTP_FAILED (send/retrieve failed)
- FTP_FINISHED (send/retrieve succeeded)
- FTP_MOREDATA (send/retrieve in progress)
Unlike ftp_fput(), this function retrieves the file asynchronously. This means your program can perform other operations while the file is downloading.
Syntax
ftp_nb_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:
|
Example
This example copies text from "source.txt" to "target.txt":
Complete PHP FTP Reference Manual