FTP_CLOSE(3) 1 FTP_CLOSE(3)ftp_close - Closes an FTP connectionSYNOPSIS
bool ftp_close (resource $ftp_stream)
DESCRIPTION ftp_close(3) closes the given link identifier and releases the resource.
Note
After calling this function, you can no longer use the FTP connection and must create a new one with ftp_connect(3).
PARAMETERS
o $ftp_stream
- The link identifier of the FTP connection.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
ftp_close(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);
// print the current directory
echo ftp_pwd($conn_id); // /
// close this connection
ftp_close($conn_id);
?>
SEE ALSO ftp_connect(3).
PHP Documentation Group FTP_CLOSE(3)
Check Out this Related Man Page
FTP_FPUT(3) 1 FTP_FPUT(3)ftp_fput - Uploads from an open file to the FTP serverSYNOPSIS
bool ftp_fput (resource $ftp_stream, string $remote_file, resource $handle, int $mode, [int $startpos])
DESCRIPTION ftp_fput(3) uploads the data from a file pointer to a remote file on the FTP server.
PARAMETERS
o $ftp_stream
- The link identifier of the FTP connection.
o $remote_file
- The remote file path.
o $handle
- An open file pointer on the local file. Reading stops at end of file.
o $mode
- The transfer mode. Must be either FTP_ASCII or FTP_BINARY.
o $startpos
-The position in the remote file to start uploading to.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
ftp_fput(3) example
<?php
// open some file for reading
$file = 'somefile.txt';
$fp = fopen($file, 'r');
// 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);
// try to upload $file
if (ftp_fput($conn_id, $file, $fp, FTP_ASCII)) {
echo "Successfully uploaded $file
";
} else {
echo "There was a problem while uploading $file
";
}
// close the connection and the file handler
ftp_close($conn_id);
fclose($fp);
?>
SEE ALSO ftp_put(3), ftp_nb_fput(3), ftp_nb_put(3).
PHP Documentation Group FTP_FPUT(3)
i need to write a shell script..
connecting to another server using ftp and check whether the file ter.txt is exists there or not.
i have written scirpt partially,as i new to Unix.
ftp -inv $FTPHOST > $TEMPFILE1 2> $TEMPFILE1 << EOF
user $FTPUSER $FTPPW
binary
prompt
${CD}
ls *.txt... (11 Replies)
Hi all,
I googled for this kind of function but didn't find anything. I have an FTP connection with a server, went to the dir. In this dir there are several TXT files. I would like to have function that downloads all this files, based on their .txt extension.
In bash, for example, simply:... (10 Replies)
Hello Unix Gurus,
Help required from you.
My requirement is something like this
I want to create a concurrenct program in Oracle Applications using shell script to transfer files from Apps Server to destination FTP server.
I have created custom program, where I will extract all the... (4 Replies)
Hi Guru's,
I am new to UNIX. my requirement is to log on to FTP server and get all the .txt files. i have developed one script by searching some forums but getting error and not able to fix them. pls see below code.
ftp -i-n<<EOF
open $FTP_HOST... (30 Replies)