PHP ftp_set_option() Function
Definition and Usage
The ftp_set_option() function sets various FTP runtime options.
Syntax
ftp_set_option(ftp_connection,option,value)
Parameter | Description |
---|---|
ftp_connection | Required. Specifies the FTP connection to be used (identifier of the FTP connection). |
option |
Required. Specifies the runtime option to be set. Possible values:
Detailed information is provided below. |
value | Required. Set the value of the option parameter. |
Description
The FTP_TIMEOUT_SEC option changes the timeout time of network transmission. Parameter value It must be an integer greater than 0. The default timeout is 90 seconds.
When the FTP_AUTOSEEK option is enabled, GET or PUT requests with resumepos or startpos parameters will first search for the specified position in the file. This option is enabled by default.
Example
<?php $conn = ftp_connect("ftp.testftp.com") or die("Could not connect"); ftp_login($conn,"admin","ert456"); ftp_set_option($conn,FTP_TIMEOUT_SEC,120); ftp_close($conn); ?>