Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ftp_raw(3) [php man page]

FTP_RAW(3)								 1								FTP_RAW(3)

ftp_raw - Sends an arbitrary command to an FTP server

SYNOPSIS
array ftp_raw (resource $ftp_stream, string $command) DESCRIPTION
Sends an arbitrary $command to the FTP server. PARAMETERS
o $ftp_stream - The link identifier of the FTP connection. o $command - The command to execute. RETURN VALUES
Returns the server's response as an array of strings. No parsing is performed on the response string, nor does ftp_raw(3) determine if the command succeeded. EXAMPLES
Example #1 Using ftp_raw(3) to login to an FTP server manually. <?php $fp = ftp_connect("ftp.example.com"); /* This is the same as: ftp_login($fp, "joeblow", "secret"); */ ftp_raw($fp, "USER joeblow"); ftp_raw($fp, "PASS secret"); ?> SEE ALSO
ftp_exec(3). PHP Documentation Group FTP_RAW(3)

Check Out this Related Man Page

FTP_ALLOC(3)								 1							      FTP_ALLOC(3)

ftp_alloc - Allocates space for a file to be uploaded

SYNOPSIS
bool ftp_alloc (resource $ftp_stream, int $filesize, [string &$result]) DESCRIPTION
Sends an ALLO command to the remote FTP server to allocate space for a file to be uploaded. Note Many FTP servers do not support this command. These servers may return a failure code ( FALSE) indicating the command is not sup- ported or a success code ( TRUE) to indicate that pre-allocation is not necessary and the client should continue as though the oper- ation were successful. Because of this, it may be best to reserve this function for servers which explicitly require preallocation. PARAMETERS
o $ftp_stream - The link identifier of the FTP connection. o $filesize - The number of bytes to allocate. o $result - A textual representation of the servers response will be returned by reference in $result if a variable is provided. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 ftp_alloc(3) example <?php $file = "/home/user/myfile"; // connect to the server $conn_id = ftp_connect('ftp.example.com'); $login_result = ftp_login($conn_id, 'anonymous', 'user@example.com'); if (ftp_alloc($conn_id, filesize($file), $result)) { echo "Space successfully allocated on server. Sending $file. "; ftp_put($conn_id, '/incomming/myfile', $file, FTP_BINARY); } else { echo "Unable to allocate space on server. Server said: $result "; } ftp_close($conn_id); ?> SEE ALSO
ftp_put(3), ftp_fput(3). PHP Documentation Group FTP_ALLOC(3)
Man Page