FTP_PWD(3) 1 FTP_PWD(3)ftp_pwd - Returns the current directory nameSYNOPSIS
string ftp_pwd (resource $ftp_stream)
DESCRIPTION PARAMETERS
o $ftp_stream
- The link identifier of the FTP connection.
RETURN VALUES
Returns the current directory name or FALSE on error.
EXAMPLES
Example #1
ftp_pwd(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);
// change directory to public_html
ftp_chdir($conn_id, 'public_html');
// print current directory
echo ftp_pwd($conn_id); // /public_html
// close the connection
ftp_close($conn_id);
?>
SEE ALSO ftp_chdir(3), ftp_cdup(3).
PHP Documentation Group FTP_PWD(3)
Check Out this Related Man Page
FTP_PASV(3) 1 FTP_PASV(3)ftp_pasv - Turns passive mode on or offSYNOPSIS
bool ftp_pasv (resource $ftp_stream, bool $pasv)
DESCRIPTION ftp_pasv(3) turns on or off passive mode. In passive mode, data connections are initiated by the client, rather than by the server. It may
be needed if the client is behind firewall.
Please note that ftp_pasv(3) can only be called after a successfull login or otherwise it will fail.
PARAMETERS
o $ftp_stream
- The link identifier of the FTP connection.
o $pasv
- If TRUE, the passive mode is turned on, else it's turned off.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
ftp_pasv(3) example
<?php
$file = 'somefile.txt';
$remote_file = 'readme.txt';
// 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);
// turn passive mode on
ftp_pasv($conn_id, true);
// upload a file
if (ftp_put($conn_id, $remote_file, $file, FTP_ASCII)) {
echo "successfully uploaded $file
";
} else {
echo "There was a problem while uploading $file
";
}
// close the connection
ftp_close($conn_id);
?>
PHP Documentation Group FTP_PASV(3)
HI All
Need a help in FTP script
i need to ask the user to enter the source ftp server and password
and target ftp server and password , once it has logged in to the source server it need to go to directory and ftp to the target server
can anyone help me on this , Sample code is... (27 Replies)
Hi
I want to FTP some file from one server to another server, those file should copy from one server to another and then move the same files to another folder in the same server. I have written the code but the text files are moving and coping but the remaing file are not moving or coping to... (4 Replies)
Hi all,
I need to create a bash script that reads a txt file on a remote (Windows 2003) server, gets the IP-addresses out of it and then fetches the folders to copy out of another txt file. (all files are auto-generated) The IP addresses that don't have a folder_list file should be ignored. At... (31 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)
Hi
I'm having some trouble with a bash shell script that I'm writing. In the script, I'm trying to upload a file to a backup repository using ftp, but the whole file doesn't get uploaded.
This is the file's properties at the start (I've highlighted the file size in red):
-rw-r--r-- 1 root... (2 Replies)
Hi Everyone,
We are migrating from FTP to SFTP. We used the following script for FTP:
echo "ftp -np -i -v << EOF" >> ${FTP_READY_FILE}
echo "open ${SRC_FTP_SERVER} " >> ${FTP_READY_FILE}
echo "user ${SRC_FTP_USER} ${SRC_FTP_PWD}" >> ${FTP_READY_FILE}
echo "binary" >> ${FTP_READY_FILE}... (5 Replies)
I am trying to understand a UNIX script which FTPs certain files from a remote location to the local machine. I understand the basic FTP command but the UNIX script uses the following command:
ftp -n -i -v > $logftp_trg 2>&1 <<!
open $MFX_FTP_SERVER
user $MFX_FTP_LOGIN $MFX_FTP_PWD
Can anyone... (5 Replies)
Hello friends
Good Morning
I have a problem with SFTP, the problem that asks me for the password and the shell stops, what I need is not to ask me for the password to take it from the variety I am giving
sftp ftpsic@$NodoFtpOms <<END_SCRIPT
quote PASS $PassFtpOms
cd $RutaFtpOms... (8 Replies)