ftp_put - FTP 서버에 파일을 업로드합니다. 정보
PHP ftp_put - FTP 서버에 파일을 업로드합니다.본문
ftp_put - FTP 서버에 파일을 업로드합니다.
설명 ¶
bool ftp_put ( resource $ftp_stream , string $remote_file , string $local_file , int $mode [, int $startpos= 0 ])
ftp_put () 은 로컬 파일을 FTP 서버에 저장합니다.
매개 변수 ¶
ftp_stream
FTP 연결의 링크 식별자입니다.
remote_file
원격 파일 경로입니다.
local_file
로컬 파일 경로.
mode
전송 모드. FTP_ASCII또는 중 하나 여야합니다 FTP_BINARY.
startpos
업로드를 시작할 원격 파일의 위치입니다.
반환 값 ¶
반환 값 TRUE성공 또는 FALSE실패.
예 ¶
Example # 1 ftp_put () 예제
<?php
$file = 'somefile.txt';
$remote_file = 'readme.txt';
// 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);
// upload a file
if (ftp_put($conn_id, $remote_file, $file, FTP_ASCII)) {
echo "successfully uploaded $file\n";
} else {
echo "There was a problem while uploading $file\n";
}
// close the connection
ftp_close($conn_id);
?>
0
댓글 0개