Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ftp_close(3) [php man page]

FTP_CLOSE(3)								 1							      FTP_CLOSE(3)

ftp_close - Closes an FTP connection

SYNOPSIS
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 server

SYNOPSIS
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)
Man Page

5 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

dlsym...error

Hi, I have ftp.so file which on nm gives the following table.... |0x0000c4f8|0x000000f0|FUNC |LOCL |0 |14 |ftp_active |0x0000c00c|0x000000f0|FUNC |LOCL |0 |14 |ftp_ascii |0x0000c0fc|0x000000f0|FUNC |LOCL |0 |14 |ftp_binary |0x0000a8e0|0x000001a8|FUNC |LOCL... (0 Replies)
Discussion started by: Vikky Panchal
0 Replies

2. Shell Programming and Scripting

need to check the file using ftp in a shell script

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)
Discussion started by: KiranKumarKarre
11 Replies

3. Shell Programming and Scripting

[php] ftp get all files from a certain file type

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)
Discussion started by: laurens
10 Replies

4. Shell Programming and Scripting

Help needed to transfer list of files to FTP server, to different folders

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)
Discussion started by: amazon
4 Replies

5. Emergency UNIX and Linux Support

Shell script to get all the files from FTP server

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)
Discussion started by: arund_01
30 Replies