(PHP 4, PHP 5, PHP 7)
ftp_fput — �ϴ�һ���Ѿ����ļ��� FTP ������
$ftp_stream
, string $remote_file
, resource $handle
, int $mode
[, int $startpos
= 0
] ) : boolftp_fput() ���������ϴ�һ�����Ѿ����ļ��е����ݵ� FTP ��������
ftp_stream
FTP ���ӵ����ӱ�ʶ����
remote_file
Զ���ļ�·����
handle
�ı����ļ��������ȡ���ļ�ĩβ��
mode
����ģʽֻ��Ϊ (�ı�ģʽ) FTP_ASCII
��
(������ģʽ) FTP_BINARY
���е�һ����
startpos
Զ���ļ��ϴ��Ŀ�ʼλ�á�
�ɹ�ʱ���� TRUE
�� ������ʧ��ʱ���� FALSE
��
Example #1 ftp_fput() ����
<?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\n";
} else {
echo "There was a problem while uploading $file\n";
}
// close the connection and the file handler
ftp_close($conn_id);
fclose($fp);
?>
�汾 | ˵�� |
---|---|
4.3.0 |
����� startpos ��֧�֡�
|