ftp_fput(3) php man page | unix.com

Man Page: ftp_fput

Operating Environment: php

Section: 3

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)
Related Man Pages
ftp_put(3) - php
ftp_ssl_connect(3) - php
ftp_fput(3) - php
ftp_nb_fget(3) - php
ftp_pasv(3) - php
Similar Topics in the Unix Linux Community
How to upload to the unix server?
changing permission using FTP
restrict file download not upload
Replace 2nd column in file
Files copied to FTP server not shown