FTP_SET_OPTION(3) 1 FTP_SET_OPTION(3)ftp_set_option - Set miscellaneous runtime FTP optionsSYNOPSIS
bool ftp_set_option (resource $ftp_stream, int $option, mixed $value)
DESCRIPTION
This function controls various runtime options for the specified FTP stream.
PARAMETERS
o $ftp_stream
- The link identifier of the FTP connection.
o $option
- Currently, the following options are supported:
Supported runtime FTP options
+----------------+---------------------------------------------------+
| | |
|FTP_TIMEOUT_SEC | |
| | |
| | Changes the timeout in seconds used for all net- |
| | work related functions. $value must be an integer |
| | that is greater than 0. The default timeout is 90 |
| | seconds. |
| | |
| | |
| FTP_AUTOSEEK | |
| | |
| | When enabled, GET or PUT requests with a |
| | $resumepos or $startpos parameter will first seek |
| | to the requested position within the file. This |
| | is enabled by default. |
| | |
+----------------+---------------------------------------------------+
o $value
- This parameter depends on which $option is chosen to be altered.
RETURN VALUES
Returns TRUE if the option could be set; FALSE if not. A warning message will be thrown if the $option is not supported or the passed
$value doesn't match the expected value for the given $option.
EXAMPLES
Example #1
ftp_set_option(3) example
<?php
// Set the network timeout to 10 seconds
ftp_set_option($conn_id, FTP_TIMEOUT_SEC, 10);
?>
SEE ALSO ftp_get_option(3).
PHP Documentation Group FTP_SET_OPTION(3)
Check Out this Related Man Page
FTP_CHDIR(3) 1 FTP_CHDIR(3)ftp_chdir - Changes the current directory on a FTP serverSYNOPSIS
bool ftp_chdir (resource $ftp_stream, string $directory)
DESCRIPTION
Changes the current directory to the specified one.
PARAMETERS
o $ftp_stream
- The link identifier of the FTP connection.
o $directory
- The target directory.
RETURN VALUES
Returns TRUE on success or FALSE on failure. If changing directory fails, PHP will also throw a warning.
EXAMPLES
Example #1
ftp_chdir(3) example
<?php
// set up basic connection
$conn_id = ftp_connect($ftp_server);
// login with username and password
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
// check connection
if ((!$conn_id) || (!$login_result)) {
die("FTP connection has failed !");
}
echo "Current directory: " . ftp_pwd($conn_id) . "
";
// try to change the directory to somedir
if (ftp_chdir($conn_id, "somedir")) {
echo "Current directory is now: " . ftp_pwd($conn_id) . "
";
} else {
echo "Couldn't change directory
";
}
// close the connection
ftp_close($conn_id);
?>
SEE ALSO ftp_cdup(3), ftp_pwd(3).
PHP Documentation Group FTP_CHDIR(3)
How do I setup a parameter driven executable script which FTP's a file (input as a parameter) in Unix (AIX) to my desktop (Windows) ?
For example I would ideally like to do this -
Unix Prompt> FtpFetch abc.log
and get this abc.log on my desktop.
Thanks to anyone that can help! I am... (1 Reply)
Why does running 5 FTP scripts sequentially take longer to run (16 seconds)
than when all 5 are submitted to a subprocess and run simultaneously (7 seconds)?
I would think there would be some I/O contention.
There are about 10 files to be FTP'd in each script.
Although each script... (0 Replies)
This is gonna sound dumb but...
1 It seems that I cannot use the search function here properly.
In researching to find a solution to an FTP error trapping issue, I go to the search option in the forum and use FTP as a search term and ask it to select all forums to search in..... I get no... (2 Replies)
Hello,
I have a FTP script below that automatically send files to host. Currently, i am having problems if our network connection is down. Our host cannot receive a file once the network connect is down.
Could there be a additional command that i need to add below so that it would not send... (4 Replies)
Guys,
I've a xlsx file containing pivot tables and my job is to FTP it from one Linux terminal to another.
I use the script below :
ftp -in xxxx > /ftp.log 2>&1 <<EOT
user xxx yyyy
binary
cd <directory>
put xxx.xlsx `basename xxx.xlsx`
bye
EOT
After the file is received in the FTP... (2 Replies)