FTP_SITE(3) 1 FTP_SITE(3)ftp_site - Sends a SITE command to the serverSYNOPSIS
bool ftp_site (resource $ftp_stream, string $command)
DESCRIPTION ftp_site(3) sends the given SITE command to the FTP server.
SITE commands are not standardized, and vary from server to server. They are useful for handling such things as file permissions and group
membership.
PARAMETERS
o $ftp_stream
- The link identifier of the FTP connection.
o $command
- The SITE command. Note that this parameter isn't escaped so there may be some issues with filenames containing spaces and other
characters.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
Sending a SITE command to an ftp server
<?php
// Connect to FTP server
$conn = ftp_connect('ftp.example.com');
if (!$conn) die('Unable to connect to ftp.example.com');
// Login as "user" with password "pass"
if (!ftp_login($conn, 'user', 'pass')) die('Error logging into ftp.example.com');
// Issue: "SITE CHMOD 0600 /home/user/privatefile" command to ftp server
if (ftp_site($conn, 'CHMOD 0600 /home/user/privatefile')) {
echo "Command executed successfully.
";
} else {
die('Command failed.');
}
?>
SEE ALSO ftp_raw(3).
PHP Documentation Group FTP_SITE(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)
What i'm looking for is a program to install on a server, that when a file is being transfered using ftp, the user is prompted for their name, and theie name, the file they downloaded, and the time are all recorded in a file somewhere.
If anyone knows of software like that it would be a great... (10 Replies)
Hello, I am a UNIX newbie and this is my first posting.
I need to create a batch command file to ftp from Sun/Solaris to AS/400.
Here is an example file:
ftp -d -i -n -v 172.28.16.22
pwd
ls
binary
quit
This is the result of executing the command file:
Connected to... (10 Replies)
To start, this thread, I have read the FTP FAQ and done a search and I can't figure this out. This is really simple, but the first command won't execute. I've removed my server name, user and pass. I've tried modeling it after some of the other examples in the FAQ using ksh, but still can't get... (8 Replies)
we migrated from a system with HPUX B.11.0 to HPUX 11.23 i64
the new server is the same IP as the old server. the old server is renumbered to something else to avoid conflict.
on the old system, we had a user named "ftp" . There is one person who daily will ftp files to the host using this... (15 Replies)
i cannot connect to my server with ftp.
--sorry for late edition.
i dont think that the problem is on windows conf because i can connect to other servers with ftp.
I cannot connect to a specific hp-ux server. it gives the failure unable to connect. (8 Replies)
Hi,
I want to connect to a remote machine using FTP, check for the size of a file there. If it is 0 bytes, then there is no need to ftp else i have to ftp the file. Any help will be highly appreciated. (7 Replies)
I am trying to setup an FTP server in a Fedora Core 3 machine through the command line interface and not KDE.
I think I am successful in getting the ftp service running, as when I do an ftp 127.0.0.1, I am able to log in using any one the user accounts I have created on this machine and browse... (8 Replies)
We receive fixed width ASCII (not EBCIDIC) file from MF to UNIX server. We have trailing spaces in the file.
What happens during FTP transmission, those trailing spaces gets chopped off. Is there any option in FTP when to transfer file from mainframes to unix not to chop off those spaces? (14 Replies)
Hi linux experts,
I am using ftp command as :
ftp hostname
but it says unable to connect,
if i am using the same in sftp it is working :
sftp hostname
it works.
so please help me how should i use ftp command. (8 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 All,
The issue is that, we have a dataset in mianframe whose record length is 153 characters. And a batch job ftpies it to the unix server(SunOS) as a test file. But the ftpied file in unix does not have a record length of 153 chars. Each record of 153 chars gets splited into two line of... (8 Replies)
Hello all,
I am having difficulties writing an ftp script to retrieve a file via get using a variable name to pass the file name.
I know the name of the file I am going to retrieve, this file name has embedded spaces and punctuation in the name itself.
If I interactively use the get and I... (10 Replies)
Hi,
I have three files in this /home/mani/ location. I would like to ftp to another server.
could you please give perl for that requirement.
Thanks,
Mani (10 Replies)
hi,
i want to use chmod command inside ftp. so that what ever files are transfered to the local server will hav 664 permission.
if i use chmod inside ftp , the file permissions gets changed in the remote server and when the file is transffered to local server using get command, it does not... (8 Replies)
I need to connect to a ftp server-1 from linux server-2 and copy/get a file from server-1 which follows a name pattern of FILENAME* (located on the root directory) and copy on a directory on server-2. Later, I have to use this file for ETL loading... For this I tried using as below
/usr/bin/ftp... (8 Replies)