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);

?>

|
댓글을 작성하시려면 로그인이 필요합니다.

개발자팁

개발과 관련된 유용한 정보를 공유하세요. 질문은 QA에서 해주시기 바랍니다.

+
분류 제목 글쓴이 날짜 조회
PHP 8년 전 조회 2,025
PHP 8년 전 조회 2,409
PHP 8년 전 조회 2,143
PHP 8년 전 조회 2,163
PHP 8년 전 조회 2,072
PHP 8년 전 조회 2,533
PHP 8년 전 조회 3,179
PHP 8년 전 조회 2,680
jQuery 8년 전 조회 2,177
jQuery 8년 전 조회 2,490
jQuery 8년 전 조회 2,210
jQuery 8년 전 조회 2,069
PHP 8년 전 조회 2,218
PHP 8년 전 조회 2,212
PHP 8년 전 조회 3,956
PHP 8년 전 조회 3,212
PHP 8년 전 조회 2,593
PHP 8년 전 조회 2,549
PHP 8년 전 조회 2,386
PHP 8년 전 조회 2,210
PHP 8년 전 조회 2,377
PHP 8년 전 조회 2,142
PHP 8년 전 조회 2,564
PHP 8년 전 조회 2,169
jQuery 8년 전 조회 3,018
jQuery 8년 전 조회 3,041
jQuery 8년 전 조회 2,024
jQuery 8년 전 조회 2,686
jQuery 8년 전 조회 2,976
jQuery 8년 전 조회 3,301
🐛 버그신고