Query: ftp_fput
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
FTP_FPUT(3) 1 FTP_FPUT(3) ftp_fput - Uploads from an open file to the FTP serverSYNOPSISbool ftp_fput (resource $ftp_stream, string $remote_file, resource $handle, int $mode, [int $startpos])DESCRIPTIONftp_fput(3) uploads the data from a file pointer to a remote file on the FTP server.PARAMETERSo $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 VALUESReturns TRUE on success or FALSE on failure.EXAMPLESExample #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 ALSOftp_put(3), ftp_nb_fput(3), ftp_nb_put(3). PHP Documentation Group FTP_FPUT(3)
Related Man Pages |
---|
ftp_nlist(3) - php |
ftp_ssl_connect(3) - php |
ftp_nb_fput(3) - php |
ftp_fget(3) - php |
ftp_nb_fget(3) - php |
Similar Topics in the Unix Linux Community |
---|
Cannot run Shell script in PHP |
How to make sure a file is uploaded in its entirety |
Understanding FTP connection code |
FTP Error 553 I/O error. |
Files copied to FTP server not shown |